If I write my own scripts which will use models and deal with them,
but I also need to set PYTHONPATH and DJANGO_SETTING_MODULE evn
variables. I know manage.py can do this thing, and I think why cann't
I use it to run my scripts which need these env variables setting. So
If I can run my scripts just like:
manage.py run myscripts.py
and I don't need to set evn variables myself. And every scripts
executed by manage.py should have a "main" function, so the process
flow in manage.py could be:
[set env variables]
import myscripts #should use __import__ and set the directory correctly
myscripts.main()
Of cause if the implementatiom don't need to import the script, it
don't need to specify the script should has a main function. May be
just import? or
[set env variables]
import myscripts #should use __import__ and set the directory correctly
if hasattr(myscripts, "main") and callable(myscripts, "main")
myscripts.main()
I don't know if this proposal is reasonable, if it's, I'll make it a ticket.
--
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---