Hi,

I have some computationally intensive initialization logic that
should
run when a new process is started up by the web server. Following
advice on the web, I've imported the module with the initialization
code from settings.py, which works perfectly as advertised. However,
it has one side effect which is very cumbersome - the code runs with
every manage command as well. Every syncdb (and migration as we use
South) takes forever. This is a problem during deployment.

What's the best way to run initialization code only when it is
executed under a server? (runserver & mod_wsgi) - is there any way to
tell that a manage command is active at the moment and what it is? I
could then not run the code for anything but runserver.

Thanks,
Boaz

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to