johnny wrote:
> Doing the following:
> 
> from os import environ
> environ['DJANGO_SETTINGS_MODULE'] = 'settings'
> from settings import *
> 
> Only works at the parent folder level.  What if you have script in sub
> folder level?  I tried it at sub folder level and got error:
> 
> from os import environ
> environ['DJANGO_SETTINGS_MODULE'] = '../settings'
> from settings import *
>>>> from apps.mail.models import Email
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named apps.mail.models
> 
> 
> > 
> 

import os
# "keeno.ru" directory contains my project directory "web_site"
sys.path.append('/web/keeno.ru')
os.environ["DJANGO_SETTINGS_MODULE"] = 'web_site.settings'

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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