python - Fail to fetch the 'next' parameter in query-string using Tornado's self.get_argument() method? -


As far as I've learned, storm is a "next" The query string parameter, which automatically represents the source URL, causes redirection.

Therefore, I am trying to make it post () to . Login handler like this:

  square login handler (tornado.web.RequestHandler): def find (auto): pass #some code def post (self): [...] #some code here: Confirm User Identification # If the verification is sent back to itself .set_secure_cookie ("username", user name) # The user is returned back to the page, then see himself. Self.redirect ("next", "/"))  

But redirection does not work well. It always redirects the user back to the URL " / ". It seems that no "Next" argument has been found, and get_argument () method always returns the default URL " / ".

To prove my suspicion, I tried to log out of self.request.arguments using Python's logging mechanism and end Confirmed in: There is no "next" argument in fact .

My question is:

  • I have the "Next" parameter, to redirect users to the page they want for?

Extra:

  • I found the same question on the stack overflow: this kind of redirection for the loan method inherited Recommends transferring.
  • My dub:

    When someone presses the "Login" button, the browser will send (username, password). On the other hand, the found () method will not be triggered during this period, depending on the code added by post () . And so, how can this redirection?


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -