List Info

Thread: mod_python apache problems...




mod_python apache problems...
user name
2006-08-27 18:07:08
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 someguysomedomain.com
    ServerName autoapp.somedomain.com
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE autosales.settings
    PythonDebug On
</VirtualHost>


I am not sure what to do. I also tried adding PythonPath
"['/path/to/project'] + sys.path" in my
virtual host entry like so:

<VirtualHost *:80>
    ServerAdmin someguysomedomain.com
    ServerName autoapp.somedomain.com
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    PythonPath "['/path/to/project'] +
sys.path"
    SetEnv DJANGO_SETTINGS_MODULE autosales.settings
    PythonDebug On
</VirtualHost>

But I still get the same message. Keep in mind that I am
restarting
apache every time I make a change.

Any ideas?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python apache problems...
user name
2006-08-27 18:35:05
 &nbsp;  PythonPath "['/path/to/project'] + sys.path&quot;

Try removing "project from path:
PythonPath "['/path/to/'] + sys.path&quot;

and add path to dkango src:
PythonPath "['/path/to/django'] + ['/path/to/topdirectoryofproject'] + sys.path&quot;


--
--
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users"; group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to django-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python apache problems...
user name
2006-08-27 19:05:43
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 someguysomedomain.com
>     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-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python apache problems...
user name
2006-08-29 23:31:37
Thanks, Ricardo. That was it 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )