I've approached this like the following, though I'd be interested to
hear if there is a better way. I like putting the environ settings in
the script itself so everything is self contained (could be run from
cron, etc)...
At the top of my Python file I have this:
import os, sys
# Connect to Django to use models
sys.path.append(os.path.expanduser('~/sandbox/myproject'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
# Pull in relevant models
from myproject.myapp.models import Model1, Model2, Model3
etc...
-Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---