Refetching a previously visited page
Posted
by
user613665
on Stack Overflow
See other posts from Stack Overflow
or by user613665
Published on 2011-02-17T01:11:09Z
Indexed on
2011/02/17
7:25 UTC
Read the original article
Hit count: 145
django
|web-development
All,
I am having a field day with page refetching. Any help or pointer will be greatly appreciated!! The behavior is a bit specific to mobile browser.
Problem:
I have two pages and created a shortcut link to pg#1 in the home page. Through a form submit button, user is taken from pg#1 to pg#2. All that is working fine.
Now once I am on pg#2. I will leave the browser and click the shortcut later. The browser will stay on pg#2 and won't go to pg#1 even though the path in URLS is different between the two views.
It is almost like Django decides that since I have already visited view#1, it doesn't need to fetch it again. This problem or behavior doesn't happen if I move the same code that handle the two views and the templates to a bare bone test project.
Setup:
I am using django-registration, context session. I am not using any HTML caching tag.
I already have DEBUG turned on in my settings.py. Are there other ways that I can tell what the server is doing.
Thanks in advance.
pdxMobile
Update:
Here is the code snippets.
def sendmsg(request):
if request.method =='POST':
messages.add_message(request, messages.INFO, "Hello world")
return redirect ('rcvmsg')
return render_to_response('sendMsg.html',RequestContext(request))
def rcvmsg(request):
'''view that receives the msg.'''
printMsg ='Didnt get a message'
if messages:
thisMsg = messages.get_messages(request)
for rcvMsg in thisMsg:
printMsg = rcvMsg
return render_to_response('rcvMsg.html',{'print_msg':printMsg},RequestContext(request))
URL:
url(r'^rcvMsg/','mydomain.mainApp.views.rcvmsg',name='rcvmsg'),
(r'^sendMsg/code','mydomain.mainApp.views.sendmsg'),
© Stack Overflow or respective owner