Jump in the way django web pages

web pages jump method

  • Forwarding (forward)
  • Redirect (redirect)

Forwarding render

The default server is the way forward jump

Forwarding features:

  1. Address bar address will not change
  2. A request
  3. You can carry data into the template
  4. Only forwards inside the server

Redirect redirect

Redirection features:

  1. The address bar will change
  2. 2 Request
  3. You can not carry the data to the Template
  4. Redirection can be redirected to an external request (e.g., Baidu)

2 redirector send request:
When a user sends a request to the background processing data, the background do use the redirect page jump if any;
then the server will respond with a special header information, including a Content-length = 0, Location and 302 status code;
then the browser receives this special header information, automatically obtains a value corresponding to Location, and automatically sending a second request

Guess you like

Origin www.cnblogs.com/leomessi10/p/11847927.html