Django - Apache + WSGI - 导入模块
我的 django 项目有这种树
project tree
project/
apache/
apache_django_wsgi.conf
project.wsgi
...
module1/
module2/
settings.py
settings_production.py
...
project.wsgi
import os, sys
apache_configuration = os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings_production'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
我收到这种错误(从模板调试):
没有名为 module1 的模块
我做错了什么?
I have this kind of tree for my django project
project tree
project/
apache/
apache_django_wsgi.conf
project.wsgi
...
module1/
module2/
settings.py
settings_production.py
...
project.wsgi
import os, sys
apache_configuration = os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings_production'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
I'm getting this kind of error (debugged on from the template):
No module named module1
What am I doing wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
还添加:
Also add: