Another problem with a file is that you generally have to rewrite the
entire file to update just one value. Suppose process A has read the
filed, then process B reads the file. Then process A updates value FOO
and overwrites the file. Process B then updates value BAR and
overwrites the file. The problem is that process B wasn't aware of the
changes made by process A, so the new value for FOO is lost. Sure, you
could create some file locking mechanism, by why? Databases address
those issues and are very good at it.

On 6/26/07, Marty Alchin <[EMAIL PROTECTED]> wrote:
>
> On 6/26/07, David Danier <[EMAIL PROTECTED]> wrote:
> > Or why not use a python-file as "cache"? AFAIK Django already reloads
> > the settings-file if is has changes. So why not use this and put the
> > settings generated from the DB there (or in some file imported in
> > settings.py). A post_save-handler in the settings-module should do the
> > rest...
> > Sorry if this is stupid and I miss some bigger picture here. ;-)
>
> I could use a file as cache, yes, but what you're dsecribing wouldn't
> really work well in production environments. To my knowledge, Django
> reloads itself in its entirety if any loaded modules are changed, not
> just a single file. Sure, these things will change rarely enough that
> it might be tolerable, but the goal of the project was to avoid
> restarting the server, and this method would do exactly that.
> Additionally, the autoreload option isn't always available depending
> on your setup.
>
> That said, mod_python does provide its own autoreloading import
> system[1], which could probably be used for this, I suppose. By doing
> it that way, it would only reload the one file, which should happen
> pretty quickly. It's definitely an approach I hadn't considered, so
> I'll add it to the list of options.
>
> -Gul
>
> [1] 
> http://www.modpython.org/live/mod_python-3.3.1/doc-html/pyapi-apmeth.html#l2h-32
>
> >
>


-- 
----
Waylan Limberg
[EMAIL PROTECTED]

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

Reply via email to