Re: newbie question about paths

2011-01-31 Thread bruno desthuilliers

On 29 jan, 17:00, Brian Craft  wrote:
> Suppose the project is /var/www/django/project. Following the django
> with wsgi docs, you would add /var/www/django to the path, and
> DJANGO_SETTINGS_MODULE would be project.settings.
>
> However, in that case, the path scheme described in the tutorial
> doesn't work, e.g. setting up admin.py for Polls as described will
> throw an error because it can't find a module Polls. Instead you have
> to "from project.Polls.models import Polls", which seems to break the
> modularity of the Polls app (since it has the project name embedded in
> it, now).
>
> So, should the wsgi config instead add /var/www/django/project to the
> path, and set DJANGO_SETTINGS_MODULE to "settings"?


Add both "/var/www/django" and "/var/www/django/project" to your
sys.path.

-- 
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.



newbie question about paths

2011-01-29 Thread Brian Craft
Suppose the project is /var/www/django/project. Following the django
with wsgi docs, you would add /var/www/django to the path, and
DJANGO_SETTINGS_MODULE would be project.settings.

However, in that case, the path scheme described in the tutorial
doesn't work, e.g. setting up admin.py for Polls as described will
throw an error because it can't find a module Polls. Instead you have
to "from project.Polls.models import Polls", which seems to break the
modularity of the Polls app (since it has the project name embedded in
it, now).

So, should the wsgi config instead add /var/www/django/project to the
path, and set DJANGO_SETTINGS_MODULE to "settings"?

-- 
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.