List Info

Thread: Actions on startup?




Actions on startup?
user name
2006-02-15 16:09:18
On 2/15/06, Ned Batchelder <nednedbatchelder.com>
wrote:
>  Actually, I was looking at the middleware, because
executing the middleware
> modules happens once on the first request.  If I put
executable code at the
> top level of a middleware module, I'll get the effect
I'm looking for.  Not
> an elegant solution, though.

Ah, right. By that logic, you could also put stuff in your
settings
module, but I agree that it'd be inelegant.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
Actions on startup?
user name
2006-02-17 02:24:42
Just to close the loop on this, I would like a supported way to execute code once on startup.&nbsp; In particular, I'll be using it to kick off database upgrade code.

--Ned.

Adrian Holovaty wrote:
mail.gmail.com" type="cite">
On 2/15/06, Ned Batchelder nedbatchelder.com">&lt;nednedbatchelder.com> wrote:
  
 Actually, I was looking at the middleware, because executing the middleware
modules happens once on the first request.  If I put executable code at the
top level of a middleware module, I'll get the effect I'm looking for.  Not
an elegant solution, though.
    

Ah, right. By that logic, you could also put stuff in your settings
module, but I agree that it'd be inelegant.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org



  

-- 
Ned Batchelder, http://nedbatchelder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users"; group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to django-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )