运行WSGI应用程序时出错,ImportError:在pythonanywhere上托管期间,没有名为“ mysite”的模块

时间:2019-02-23 06:36:19

标签: django hosting wsgi pythonanywhere

我正在尝试使用pythonanywhere在整个项目中部署Django项目,但遇到了问题并且确实卡住了。谁能帮助我。

我从2天开始就坚持使用。请帮助我解决此错误。

WSGI.py配置

import os
import sys

path = '/home/blogaspp/django_project'
if path not in sys.path:
    sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings'


from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

重新加载页面后显示的错误是

2019-02-22 15:32:43,068: Error running WSGI application
2019-02-22 15:32:43,078: ImportError: No module named 'mysite'
2019-02-22 15:32:43,078:   File "/var/www/blogaspp_pythonanywhere_com_wsgi.py", line 16, in <module>
2019-02-22 15:32:43,079:     application = get_wsgi_application()
2019-02-22 15:32:43,079: 
2019-02-22 15:32:43,079:   File "/home/blogaspp/.virtualenvs/myenv/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-02-22 15:32:43,079:     django.setup(set_prefix=False)
2019-02-22 15:32:43,080: 
2019-02-22 15:32:43,080:   File "/home/blogaspp/.virtualenvs/myenv/lib/python3.5/site-packages/django/__init__.py", line 19, in setup
2019-02-22 15:32:43,080:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2019-02-22 15:32:43,080: 
2019-02-22 15:32:43,080:   File "/home/blogaspp/.virtualenvs/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 57, in __getattr__
2019-02-22 15:32:43,081:     self._setup(name)
2019-02-22 15:32:43,081: 
2019-02-22 15:32:43,081:   File "/home/blogaspp/.virtualenvs/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 44, in _setup
2019-02-22 15:32:43,082:     self._wrapped = Settings(settings_module)
2019-02-22 15:32:43,082: 
2019-02-22 15:32:43,082:   File "/home/blogaspp/.virtualenvs/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 107, in __init__

0 个答案:

没有答案