由于WSGI应用程序问题,我无法在pythonanywhere中部署我的项目

2024-06-26 14:02:40 发布

您现在位置:Python中文网/ 问答频道 /正文

Error running WSGI application Improperly Configured: Requested
setting LOGGING_CONFIG, but settings are not configured. You must
either define the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.


2017-12-11 07:01:22,866: If you're seeing an import error and don't know why, 2017-12-11 07:01:22,866: we have a dedicated help page to help you debug:  2017-12-11 07:01:22,866:   
https://help.pythonanywhere.com/pages/DebuggingImportError/   
2017-12-11 07:01:22,866:   
2017-12-11 07:01:27,434: Error running WSGI application 2017-12-11 07:01:27,434:
ImportError: No module named django.core.wsgi 2017-12-11 07:01:27,434:   File   
"/var/www/patilnayan092_pythonanywhere_com_wsgi.py", line 36, in   
<module> 2017-12-11 07:01:27,435: from django.core.wsgi import   
get_wsgi_application 2017-12-11 07:01:27,435:   
2017-12-11 07:01:27,435: If you're seeing an import error and don't know why,   
2017-12-11 07:01:27,435: we have a dedicated help page to help you   
debug:  2017-12-11 07:01:27,435:   
https://help.pythonanywhere.com/pages/DebuggingImportError/

<b>**NOTE below for the patilnayan092_pythonanywhere_com_wsgi.py
file:**</b>

import os import sys path = u'/home/patilnayan092/online_test/' if
path not in sys.path:
sys.path.append(path) os.environ['DJANGO_SETTING_MODULE'] = 'online_test.settings' from django.core.wsgi import
get_wsgi_application [This is line 36] application =
get_wsgi_application()

注意:对于这个需求版本,我使用了python2.7版本和django1.9.5版本。这个WSGI-python应用程序可能存在哪些问题?你知道吗


Tags: pathdjangocoreimportcomyouwsgiget