Waylan Limberg wrote:
> > Thx - it works - but why?
> > ;-)
>
> I'm guessing you used manage.py shell??? That sets the
> DJANGO_SETTINGS_MODULE to the setting.py file in the current directory
> for you so everything just works.
Nope - I've used the "normal" Python-Interpreter.
Timothy
--~
On 8/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> [EMAIL PROTECTED] wrote:
> > Try this:
> >
> > import sys
> > import os
> > sys.path.append('path to where mysite is')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
> >
> > from mysite.myapp.views import *
> > from mysit
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> > Try this:
> >
> > import sys
> > import os
> > sys.path.append('path to where mysite is')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
> >
> > from mysite.myapp.views import *
> > from mysite.myapp.models import *
>
> Thx - i
Nathan R. Yergler wrote:
> Because the environment variable (DJANGO_SETTINGS_MODULE) needs to point
> to the Python module in Python package syntax (ie, dotted path syntax).
Okay - I thought it must be in Linux-Syntax (full-path).
But why does it works in the Interpreter with the Linux-Syntax
(/h
Because the environment variable (DJANGO_SETTINGS_MODULE) needs to point
to the Python module in Python package syntax (ie, dotted path syntax).
So the package ("mysite" in the example below) must be on the Python
path (which is what sys.path.append does below).
On Fri, 2006-08-25 at 11:52 -0700,
[EMAIL PROTECTED] wrote:
> Try this:
>
> import sys
> import os
> sys.path.append('path to where mysite is')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
> from mysite.myapp.views import *
> from mysite.myapp.models import *
Thx - it works - but why?
;-)
Timothy
--~--~
Try this:
import sys
import os
sys.path.append('path to where mysite is')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from mysite.myapp.views import *
from mysite.myapp.models import *
--~--~-~--~~~---~--~~
You received this message because you are
7 matches
Mail list logo