- 论坛徽章:
- 0
|
一个Django project用开发服务器已经可以正常运行,远程访问正常。但是加到apache中远程访问就会报错,请帮忙看看到底是哪里配置错了?谢谢。好几天了,郁闷死。(初学,请原谅):
--------页面报错信息-------------
MOD_PYTHON ERROR
ProcessId: 3803
Interpreter: 'ABC.ABC'
ServerName: 'ABC.ABC'
DocumentRoot: '/srv/www/htdocs'
URI: '/'
Location: '/'
Directory: None
Filename: '/srv/www/htdocs/'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)
File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 228, in handler
return ModPythonHandler()(req)
File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 191, in __call__
self.load_middleware()
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 31, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 28, in __getattr__
self._import_settings()
File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 59, in _import_settings
self._target = Settings(settings_module)
File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 94, 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 'abc.settings' (Is it on sys.path? Does it have syntax errors?): No module named abc.settings
--------------------------------------------------------------
/home/admin/django/abc是项目目录,abc是项目名称
--------------------------------------------------------------
/etc/apache2/httpd.conf配置如下:
......
### Add mod_python #################################
LoadModule python_module /usr/lib/apache2/mod_python.so
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE abc.settings
PythonDebug On
PythonPath "['/home/admin/django','/home/admin/django/abc','/usr/lib/python2.5/site-packages/django']+sys.path"
</Location>
....
-----------------------
OS: openSuSE 10.3; Apache 2.2; Django 1.x
[ 本帖最后由 糊涂得紧 于 2009-2-21 17:25 编辑 ] |
|