I have seen previous posts regarding this issue, and I'm pretty sure
that I'm not running into similar issues that others have faced.  I'm
a bit stuck as to where to go.

I'm running Apache2, python2.3, mod_python, latest django and CentOS
4.5.

I've got a django project located at:

/home/george/testing/myapp

Meaning that my settings.py file is at /home/george/testing/myapp/
settings.py

I've got the following configuration in my /etc/httpd/conf.d/
python.conf file:

<Location "/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        PythonPath "['/home/george/testing'] + sys.path"
        SetEnv DJANGO_SETTINGS_MODULE myapp.settings
        PythonDebug On
</Location>

When I try viewing the root in a web browser, I get the following:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
    return ModPythonHandler()(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 146, in __call__
    self.load_middleware()

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 22, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 28, in __getattr__
    self._import_settings()

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 57, in _import_settings
    self._target = Settings(settings_module)

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 85, 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 'myapp.settings' (Is it on
sys.path? Does it have syntax errors?): No module named myapp.settings

I'm pretty sure that there isn't some collision happening with a built
in python library because if I open the python interpreter and enter:

import sys
sys.path.append('/home/george/testing')
import myapp.settings

Then I am able to see variables defined in the settings.py file.  For
good measure I also tried adding the parent directory (because I
remember seeing this solution as well) into the python path, both:

PythonPath "['/home/george', '/home/george/testing'] + sys.path"
and
PythonPath "['/home/george/testing', 'home/george'] + sys.path"

But neither of these solutions worked.  I still got the same error.

Is there an easy way to check what the runtime sys.path is?  I don't
see how it could be loading the wrong version of myapp given that a
quick 'find / -name 'myapp' -print' turns up only my /home/george/
testing/myapp.  Is there something else I should be trying?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to