On Sun, Aug 27, 2006 at 06:07:08PM -0000, mediumgrade wrote: > > I am trying to setup my django site using mod_python and apache. > > My Django project is called "autosales" and it works just fine when > accessing it from the development web server. However, when I try to > access it from apache, I get the following error > > EnvironmentError: Could not import settings 'autosales.settings' (Is it > on sys.path? Does it have syntax errors?): No module named > autosales.settings > > Here is my apache virtual host entry: > > <VirtualHost *:80> > ServerAdmin [EMAIL PROTECTED] > ServerName autoapp.somedomain.com > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE autosales.settings > PythonDebug On > </VirtualHost> >
I have something like this running, and the equivalent configuration would be <VirtualHost *:80> ServerName autoapp.somedomain.com SetHandler python-program PythonPath "['/path/to/project/parent'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE autosales.settings PythonDebug On </VirtualHost> So, if you have your project located at /var/www/django/autosales, then the PythonPath should be "['/var/www/django'] + sys.path" HTH Ricardo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---