Django-Apache+;WSGI-导入模块
我的django项目有这种树 项目树Django-Apache+;WSGI-导入模块,django,apache,import,wsgi,Django,Apache,Import,Wsgi,我的django项目有这种树 项目树 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.
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的模块
我做错了什么?还要添加:
sys.path.append(project)