Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/modpython.py", line 228, in handler
return ModPythonHandler()(req)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/modpython.py", line 191, in __call__
self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 33, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/usr/local/lib/python2.6/dist-packages/django/utils/functional.py", line 269, in __getattr__
self._setup()
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 75, in __init__
raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'djangotest.settings' (Is it on sys.path? Does it have syntax errors?): No module named project.settings
=================
原因是:PythonPath "['/var/www/html/syslogApp'] + sys.path"
不需要加上syslogApp项目的具体目录,只需要上一级的目录.
如下配置即可:
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE syslogApp.settings
PythonPath "['/var/www/html'] + sys.path"
PythonDebug On