Hi, > So, this all works fine on the development server on my laptop using > the latest django trunk, but on webfactions server it doesn't work all > of the time. Sometimes when I access my object_detail( by the way I > also wrote my own freeform.html in templates/comments and modified it > to use the fake_username as the person_name) it shows the name and > then if I use Ctrl-R in firefox to refresh the page it shows nothing. > If I hit Ctrl-R again it puts my name back, and so on. It's like there > there are two copies of the global that I am accessing. I can't figure > this out. Any ideas? Thanks so much!
The global variable you've defined is global "per-process". It's likely that you've two or more processes setup to serve your Django requests. In that case, there's no guarantee that every request from one user will always go through the same process. This is what you are seeing. In general, it's not a good idea to use globals in this way. You have a few options: The simplest one is to store that variable's value in the request session. It will not be an application level global but you will get the same value for it for any number of requests made by one user during his session with your site. If I misunderstood what you are trying to do and you need a truly global storage for this value, you could store that value in: - your DB or - memcached (assuming it's possible to install and run memcached with your hosting account) or - a file on the filesystem -Rajesh D --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---