I have a view that accepts input from the user and in a successful message, it redirects to another page. This is almost the same code in the tutorial:
def quex(request, id, question_number): next_question = int(question_number) + 1 if request.method == 'POST':
urls.py
urlpatterns = patterns('', url(r'^$', 'django.contrib.auth.views.login'), url(r'^logout$', 'screening.views.logout_view'), url(r'^home/$', 'screening.views.home'), url(r'^quex/new/$', 'screening.views.new_quex'),
The code works and the page behaves correctly.
My problem is that the URL displayed on the client is not updating correctly. The original page is http://foo.com/questionnaire/ / 1 /, and the redirected page is http://foo.com/questionnaire/ / 2 /. The old URL continues to appear in the address bar of the browser even after redirecting.
Server status messages look great:
[19/Aug/2013 19:15:40] "GET /quex/P54C9UCS/1/ HTTP/1.1" 200 3225 [19/Aug/2013 19:15:44] "POST /quex/P54C9UCS/1/ HTTP/1.1" 302 0 [19/Aug/2013 19:15:44] "GET /quex/P54C9UCS/2/ HTTP/1.1" 200 3206
What am I doing wrong? How can I get the browser to display the correct URL?
Edit: I did a bit more testing. Chrome, Safari (on OS X and iOS) and Firefox display the URL as described above. But the Khmer Browser on iOS shows the URL as http://foo.com/quex/<id>/1/#/quex/<id>/2/ .
source share