Hi, On Sat, Sep 29, 2007 at 10:06:19PM -0700, pength wrote: > well, I am doing some similiar things, for example, I want to show the > time when this Django/Apache server start, and set some "gloabl > variables" which all of my apps can use, just do like this: > I have a primary app named "city", and every other app's views.py will > add a line as "from myproject.city.models import * ". So in this > models.py, just add codes like: > SERVER_START_TIME = datetime.datetime.now() > MY_GLOBAL_VAR = (1,2,3) > #test > def my_init(): > for i in range(1,11): > print i > > my_init()
Except when apache spawns multiple processes or threads you'll probably get a different answer depending on which one you happen to end up talking to. That may be acceptable, though. -Forest -- Forest Bond http://www.alittletooquiet.net
signature.asc
Description: Digital signature