I've seen various posts with similar problems, but not managed to find
consistent advice on trouble shooting this issue.
I've got an installation of xampp Apache 2.2 and mod_python 3.2.10 and
Python 2.5. Running on Windows 2003 server.
I have mod_python working fine in apache - I can view the contents of a
simple python file (mptest from mod_python testing).
I installed Django - I did this from the latest files via Subversion,
because the install file on Official version failed several times (the
note said Python 2.5 may cause problems)
I've added details of my project file in a location statement to
httpd.conf.
However, when I open the project in the browser:
http://localhost:8888/myproject/
I get the following error(s) displayed in the browser:
-----------------------------------------------
Mod_python error: "PythonHandler django.core.handlers.modpython"
Traceback (most recent call last):
File "D:\Python25\Lib\site-packages\mod_python\apache.py", line 299,
in HandlerDispatch
result = object(req)
File
"D:\Python25\lib\site-packages\django\core\handlers\modpython.py", line
177, in handler
return ModPythonHandler()(req)
File
"D:\Python25\lib\site-packages\django\core\handlers\modpython.py", line
145, in __call__
self.load_middleware()
File "D:\Python25\lib\site-packages\django\core\handlers\base.py",
line 22, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "D:\Python25\lib\site-packages\django\conf\__init__.py", line
27, in __getattr__
self._import_settings()
File "D:\Python25\lib\site-packages\django\conf\__init__.py", line
54, in _import_settings
self._target = Settings(settings_module)
File "D:\Python25\lib\site-packages\django\conf\__init__.py", line
82, in __init__
raise EnvironmentError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'myproject.settings' (Is it
on sys.path? Does it have syntax errors?): No module named
myproject.settings
------------------------------------------
My httpd.conf file has the following settings at the end:
--
<Directory "d:/program files/xampp/htdocs/test">
AllowOverride FIleinfo
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>
<Location "/,yproject/">
SetHandler python-program
PythonPath "['d:/program files/xampp/htdocs/myproject'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonDebug On
</Location>
--
I've checked the "import django" from the python command line and there
were no errors, so I believe it's installed and accessible.
I've tried manually adding to sys.path the directories of the django
installation and my project with no effect. I'm wondering whether by
manually installing the django files from subversion I missed some key
settings, but I've not found any notes to allow me to check.
Can anyone give me any pointers for resolving this behaviour?