Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python wsgi应用程序名称';基本方向';没有定义_Python_Django_Wsgi_Pythonanywhere - Fatal编程技术网

Python wsgi应用程序名称';基本方向';没有定义

Python wsgi应用程序名称';基本方向';没有定义,python,django,wsgi,pythonanywhere,Python,Django,Wsgi,Pythonanywhere,我在pythonanywhere.com上部署了django应用程序。我看到了这个错误。 我找了很多,但什么也没找到。我被wsgi卡住了,不知道该怎么办。请帮忙 2020-05-27 04:56:19,548: Error running WSGI application 2020-05-27 04:56:19,549: NameError: name 'BASE_DIR' is not defined 2020-05-27 04:56:19,549: File "/var/www/rash

我在pythonanywhere.com上部署了django应用程序。我看到了这个错误。 我找了很多,但什么也没找到。我被wsgi卡住了,不知道该怎么办。请帮忙

2020-05-27 04:56:19,548: Error running WSGI application
2020-05-27 04:56:19,549: NameError: name 'BASE_DIR' is not defined
2020-05-27 04:56:19,549:   File "/var/www/rashidtaha_pythonanywhere_com_wsgi.py", line 15, in <module>
2020-05-27 04:56:19,549:     application = get_wsgi_application()
2020-05-27 04:56:19,549: 
2020-05-27 04:56:19,549:   File "/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-05-27 04:56:19,549:     django.setup(set_prefix=False)
2020-05-27 04:56:19,549: 
2020-05-27 04:56:19,549:   File "/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
2020-05-27 04:56:19,549:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19,550:   File "/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
2020-05-27 04:56:19,550:     self._setup(name)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19,550:   File "/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
2020-05-27 04:56:19,550:     self._wrapped = Settings(settings_module)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19,550:   File "/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
2020-05-27 04:56:19,550:     mod = importlib.import_module(self.SETTINGS_MODULE)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19,550:   File "/home/rashidtaha/rashidtaha.pythonanywhere.com/env/lib/python3.8/site-packages/isort/__init__.py", line 25, in <module>
2020-05-27 04:56:19,551:     from . import settings  # noqa: F401
2020-05-27 04:56:19,551: 
2020-05-27 04:56:19,551:   File "/home/rashidtaha/rashidtaha.pythonanywhere.com/env/lib/python3.8/site-packages/isort/settings.py", line 359, in <module>
2020-05-27 04:56:19,551:     STATIC_ROOT = os.path.join(BASE_DIR, 'static')
2020-05-27 04:56:19,551: ***************************************************
2020-05-27 04:56:19,551: If you're seeing an import error and don't know why,
2020-05-27 04:56:19,551: we have a dedicated help page to help you debug: 
2020-05-27 04:56:19,551: https://help.pythonanywhere.com/pages/DebuggingImportError/
2020-05-27 04:56:19548:运行WSGI应用程序时出错
2020-05-27 04:56:19549:名称错误:未定义名称“BASE_DIR”
2020-05-27 04:56:19549:文件“/var/www/rashidtaha_pythonanwhere_com_wsgi.py”,第15行,在
2020-05-27 04:56:19549:application=get\u wsgi\u application()
2020-05-27 04:56:19,549: 
2020-05-27 04:56:19549:get\wsgi\u应用程序第12行的文件“/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site packages/django/core/wsgi.py”
2020-05-27 04:56:19549:django.setup(set_prefix=False)
2020-05-27 04:56:19,549: 
2020-05-27 04:56:19549:文件“/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site packages/django/_u init_uuuuuuuuu.py”,第19行,在安装程序中
2020-05-27 04:56:19549:配置日志(settings.logging\u CONFIG,settings.logging)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19550:File“/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site packages/django/conf/uuuuu init_uuuuuuuuuuu.py”,第76行,在__
2020-05-27 04:56:19550:自我设置(名称)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19550:File“/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site packages/django/conf/uuu init_uuuuuu.py”,第63行,在安装程序中
2020-05-27 04:56:19550:自我包装=设置(设置模块)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19550:文件“/home/rashidtaha/.virtualenvs/rashidtaha.pythonanywhere.com/lib/python3.6/site packages/django/conf/uuuu init_uuu.py”,第142行__
2020-05-27 04:56:19550:mod=importlib.import\u模块(自我设置模块)
2020-05-27 04:56:19,550: 
2020-05-27 04:56:19550:文件“/home/rashidtaha/rashidtaha.pythonanywhere.com/env/lib/python3.8/site packages/isort/_init__.py”,第25行
2020-05-27 04:56:19551:从。导入设置#noqa:F401
2020-05-27 04:56:19,551: 
2020-05-27 04:56:19551:文件“/home/rashidtaha/rashidtaha.pythonanywhere.com/env/lib/python3.8/site packages/isort/settings.py”,第359行
2020-05-27 04:56:19551:STATIC\u ROOT=os.path.join(BASE\u DIR,“STATIC”)
2020-05-27 04:56:19,551: ***************************************************
2020-05-27 04:56:19551:如果您看到导入错误并且不知道原因,
2020-05-27 04:56:19551:我们有一个专门的帮助页面来帮助您调试:
2020-05-27 04:56:19,551: https://help.pythonanywhere.com/pages/DebuggingImportError/

听起来好像设置文件中没有定义
BASE\u DIR
。 以下内容在某种程度上取决于您的项目布局。但这就是我在这些项目中使用的

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
如果您愿意共享您的文件结构,则可以对其进行调整