Hello,

I have just started developing with Django on Apache and have ran into
a very annoying issue that I can not seem to find the answer to.

I set variables in my views and some get updated through the template
immediately and others do not.  I have to wait 15 seconds for the page
to refresh.

A simple view from the Django Book.

def form_letter(request):
     warranty = True
     return render_to_response('form_letter.html',
                                {'person_name': 'John Smith',
                                 'company': 'Super Lawn Mower',
                                 'ship_date': datetime.datetime.now(),
                                 'ordered_warranty': warranty,
                                 'item_list': ['Blade', 'Hat', 'Saw',
'Gas Can']
                                }
                               )

I have a condition in the Template to toggle some output based on
warranty.
The date will update every time I click the refresh button, but once
the warranty information has been set it does not matter what I do in
the view.  If I change the view from True to False or False to True I
have to wait 15 seconds before the page will refresh with the contents
of the view.  What's confuses me is that the date will change.  If I
change the warranty from True to False and refresh the page, the date
will update every time, but the warranty will not update till I wait
for the mystical timeout period to expire.

It's painful to develop this way.  Apparently this does not happen on
Django development server, but I didn't see any need to use this since
I have an apache server dedicated for development.

This site shows the issue, but I am still new to Django, so I am not
fully understanding his solution.
http://dai5ychain.net/jake/2007/09/21/django-snakebite-when-things-get-evaluated/

If someone could explain what is going on and post a work around, I
would greatly appreciate it.

Thank you.

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

Reply via email to