0

这是我的 django.wsgi 文件:

import os
import sys

path1 = '/srv/site/app'
path2 = '/srv/site'

if path1 not in sys.path:
    sys.path.insert(0,path1)

if path2 not in sys.path:
    sys.path.insert(1,path2)

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

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

    ImportError: Could not import settings 'app.settings' (Is it on sys.path?): No module named app.settings

Apache 没有找到设置文件。我不知道什么时候出错了。

4

1 回答 1

1
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
于 2013-03-13T14:16:22.730 回答