python: django - executing standalone scripts, environment variables 
$ python
>>>
>>> import os
>>> os.environ['DJANGO_SETTINGS_MODULE'] = "projectname.settings"
>>>
>>> import sys
>>> sys.path.append("/home/user/projectname/")
>>> from appname.views import *


[ add comment ] ( 6 views )   |  [ 0 trackbacks ]   |  permalink  |  related link

<<First <Back | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Next> Last>>