On Aug 5, 2006, at 10:32 PM, Malcolm Tredinnick wrote:

> On Sun, 2006-08-06 at 07:05 +0800, limodou wrote:
>> 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
>
> Rather than adding another feature to manage.py, I moved the  
> environment
> setup lines out into their own function (in r3527). Now, if you  
> want to
> write a script that operates in the same environment as manage.py  
> would
> set up, you call
>
>         django.core.management.setup_environ()
>
> early on in your main method and it should work seamlessly.

Ooooh. That's pretty.

Thank you, Malcom!!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to