atom feed6 messages in com.googlegroups.django-usersImportError: No module named mysite.s...
FromSent OnAttachments
Mark PhillipsMay 14, 2007 2:07 am 
Malcolm TredinnickMay 14, 2007 2:12 am 
Steven ArmstrongMay 14, 2007 2:13 am 
Mark PhillipsMay 14, 2007 7:14 am 
ilDaveMay 14, 2007 7:41 am 
Mark PhillipsMay 15, 2007 8:18 am 
Subject:ImportError: No module named mysite.settings
From:Mark Phillips (m.@mophilly.com)
Date:May 14, 2007 2:07:57 am
List:com.googlegroups.django-users

Decided to try a clean slate. Set up Django on SME Server 7.1, which is based on Centos 4. Compiled and installed mod_python Amended httpd.conf as follows:

LoadModule python_module modules/mod_python.so

and later on in the file... <Location "/mysite/"> SetHandler python-program PythonPath "['/usr/local/mysite'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonDebug On PythonAutoReload On </Location>

Downloaded Django into python2.3/site-packages with svn co http:// code.djangoproject.com/svn/django/trunk/django django

Restarted the server. Created a new project "mysite". Left the file mysite.settings as created by "startproject". The manage.py validate and runserver methods ran without errors.

Ran into trouble when attempting to browse to the site "www.myweb.com/ mysite". Here is the trace back from the browser:

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 177, in handler return ModPythonHandler()(req)

File "/usr/lib/python2.3/site-packages/django/core/handlers/ modpython.py", line 145, 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 55, in _import_settings self._target = Settings(settings_module)

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

Where did I goof?