On Fri, Sep 12, 2008 at 11:47 AM, Tonu Mikk <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I am having trouble configuring Apache and mod_python to work with my
> project.
>
> I am using Ubuntu Linux 7.10 with Apache 2.  My project is in
> /var/www/polls directory.  This is also where the settings.py file is.
> This directory and all files and directories are owned by  www-data (the
> user under which Apache is running) and they have 755 rights.
>
> I have configured Apache httpd.conf file like so (only relevant parts
> are included):
>
>    <Directory "/var/www/polls/">
>        Order allow,deny
>        allow from all
>        </Directory>
>
> <Location "/polls/">
>    SetHandler python-program
>    PythonHandler django.core.handlers.modpython
>    PythonPath "['/var/www/polls'] + sys.path"
>    SetEnv DJANGO_SETTINGS_MODULE polls.settings
>    PythonDebug On
> </Location>
>
> I am getting the following error when I access ciaran.dmc.umn.edu/polls
> ImportError: Could not import settings 'polls.settings' (Is it on sys.path?
> Does it have syntax errors?): No module named polls.settings
>

You either want to have '/var/www' in PythonPath or specify
DJANGO_SETTINGS_MODULE as just settings, not polls.settings. As it is now
Python will be looking for /var/www/polls/polls/settings.py (then searching
the rest of sys.path for it when it's not found).

Which one you want rather depends on the imports you use in the rest of your
project. If you import from 'polls.whatever' then you need '/var/www' in
PythonPath.  If you omit the 'polls' part in your imports, then you need
'/var/www/polls' in your PyrhonPath.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to