我正在尝试使用 apache webserver 在 RedHat5.6 服务器上以生产模式部署mayan-edms一个 django web 应用程序。
我已经设置了数据库并使用了虚拟环境来设置环境
这是我的 httpd.conf
WSGIScriptAlias /mayan /var/www/mayan/mayan/wsgi/dispatch.wsgi
WSGIPythonPath /var/www/mayan/mayan:/var/www/mayan/lib/python2.6/site-packages
<Directory /var/www/mayan/mayan>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
如果我用这个 conf 启动 apache,我会收到 500 错误。谁能告诉我它在哪里配置错误?
这是错误
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] mod_wsgi (pid=21715): Exception occurred processing WSGI script '/var/www/mayan/mayan/wsgi/dispatch.wsgi'.
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] Traceback (most recent call last):
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] File "/var/www/mayan/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 250, in __call__
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] self.load_middleware()
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] File "/var/www/mayan/lib/python2.6/site-packages/django/core/handlers/base.py", line 45, in load_middleware
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] mod = import_module(mw_module)
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] File "/var/www/mayan/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] __import__(name)
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] File "/var/www/mayan/mayan/apps/common/__init__.py", line 17
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] from .conf.settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME,
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] ^
[Mon Jan 14 12:47:02 2013] [error] [client 130.229.146.48] SyntaxError: invalid syntax
这是我在第 17 行的 init.py
from django.db import transaction, DatabaseError
from navigation.api import register_links, register_top_menu
from .conf.settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME, AUTO_ADMIN_PASSWORD, TEMPORARY_DIRECTORY)
from .conf import settings as common_settings
from .utils import validate_path
from .models import AutoAdminSingleton