【发布时间】:2017-09-03 11:20:12
【问题描述】:
我尝试在 pythonanywhere 部署我的项目。 我的结构
MyBlog
│ ├── blog
│ │ ├── blog
│ │ │ ├── __init__.py
│ │ │ ├── __init__.pyc
│ │ │ ├── settings.py
│ │ │ ├── settings.pyc
│ │ │ ├── urls.py
│ │ │ ├── urls.pyc
│ │ │ └── wsgi.py
│ │ ├── db.sqlite3
│ │ ├── manage.py
│ │ ├── posts
│ │ │ ├── __init__.py
│ │ │ ├── __init__.pyc
.........
我在服务器上的 wsgi 文件
import os
import sys
path = '/home/Ivan/MyBlog' # use your own username here
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'blog.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
我错了:
Error running WSGI application
ImportError: No module named blog.settings
File "/var/www/ivan_pythonanywhere_com_wsgi.py", line 11, in <module>
application = get_wsgi_application()
有什么问题?
【问题讨论】:
-
blog.blog.settings那行不行? -
错误运行 WSGI 应用程序 ImportError: No module named blog.blog.settings File "/var/www/ivan_pythonanywhere_com_wsgi.py", line 11, in
application = get_wsgi_application()