Why not just have a global in your view.py?

Alternatively, if you need to access the object from multiple views, 
then implement a singleton in a module, initialize it by importing into 
settings.py, and then import it into any view that needs it.

settings.py works similarly.   The values in settings.py are initialized 
at startup, are available to any view that imports settings, and persist 
until shut down.  

Only thing to watch out for is if you change the state of the object.  
In that case access to changing values needs to be synchronized.



qwcode wrote:
> This is a re-phrase of a previous email... trying to trigger an answer
> using terms that might make more sense to this list.  I'm more
> familiar with java frameworks.
>
> Is there a way to have objects persist in memory that don't time out?
>
> For example, in cherrypy, there's an Application object that persists
> from when cherrypy starts until  it stops.  In Java frameworks,
> there's the ServletContext.  .Net apps have something similar.
>
> Is this not supported in wsgi?
>
> Thanks
> >
>
>   


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

begin:vcard
fn:Robert Mela
n:Mela;Robert
adr;dom:;;;Lexington;MA
email;internet:rm...@rcn.com
tel;cell:781-363-0982
x-mozilla-html:FALSE
version:2.1
end:vcard

Reply via email to