Re: Cannot Redirect to other page

2020-04-17 Thread pui hei Li
Thank you so much, I have fixed the problem, now I can redirect to the pages I want. *morse_logs/game2.html* {% extends "morse_logs/base.html" %} {% block content %} GAME 2 GAME 2 2 + 2 = ? {% csrf_token %} {% endblock content %} *morse_logs/v

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
I did include example, the last sentence of the first paragraph. You need to get rid of the inner function, I don't know why that was written. I needs to look more if request.method =="GET": return the regular page elif request.method == "POST": process the answers that have been sent by t

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
I did include some examples, the last sentence of the first paragraph. You need to get rid of the inner function, I don't know why it was created. It needs to look more like this if request.method == "GET": On Wednesday, April 15, 2020 at 8:22:35 PM UTC+8, pui hei Li wrote: > > I am writing a

Re: Cannot Redirect to other page

2020-04-16 Thread pui hei Li
Thank you for your reply, but I don't really understand how am i able to make it to the page I want, does it mean I need to write a new function in view and pass in the retrieved answer from user, then do the redirection/ rendering? Could you give me some hints about how the syntax would be, becaus

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
So the "return" inside the inner function won't automatically "trigger". `redirect` is a shortcut function which constructs a HttpResponseRedirect. At the moment, you're calling the function, and the HttpResponseRedirect instance is returned from the function you're not actually doing anything