On Wed, Jan 28, 2009 at 1:48 PM, saturdayplace <saturdaypl...@gmail.com>wrote:
> > I'm trying to get Django set up on a new webserver, and I get the > above error. Here's my setup: > > $python > Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) > [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> > >>> import django > >>> django.VERSION > (1, 0, 2, 'final', 0) > >>> import mod_python > >>> mod_python.version > '3.3.1' > >>> > So you can import django code from a login shell, OK. > > my SETTINGS file is located at /home/thunsaker/django-projects/ > testproj/settings.py > > My httpd.conf: > > <Location "/djangotest/"> > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE testproj.settings > PythonOption django.root /djangotest > PythonDebug On > PythonPath "['/home/thunsaker/django-projects'] + sys.path" > </Location> > > Navigating to myurl.com/djangotest (without a trailing slash) gets > Apache's regular 404. There's a trailing slash on your Location directive, so Apache won't even try to route this one through mod_python. > > Navigating to myurl.com/djangotest/ (with trailing slash) give the > following error: > This one does get routedthrough mod_python, since it matches your Location block.... > > MOD_PYTHON ERROR > > ProcessId: 2617 > Interpreter: 'www2.mydomain.com' > > ServerName: 'www2.mydomain.com' > DocumentRoot: '/var/www/html' > > URI: '/djangotest/' > Location: '/djangotest/' > Directory: None > Filename: '/var/www/html/djangotest' > 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 > 1202, in _process_target > module = import_module(module_name, path=path) > > File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line > 304, in import_module > return __import__(module_name, {}, {}, ['*']) > > ImportError: No module named django.core.handlers.modpython > > ...but when mod_python attempts to import django.core.handlers.modpython, it gets an import error. The two common reasons for that are either the location of the Django code is not in sys.path, or the Apache process does not have the necessary permissions to access the Django code. So the next question is where/how did you install Django? Karen --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---