djanao request lifecycle

djanao request lifecycle

  1. The browser sends a request to the server
  2. Wsgi side service server receives a request from the browser to do some preprocessing of the request, the browser request information (request method, request header, socket information, etc.) are encapsulated in the request object.
  3. Django middleware corresponding to the guard, and a filter able to do the check point for all requests, such as a common CSRF (cross-site request forgery) can be prevented by the Django CSRF middleware as well as user control request frequency so it can be placed on middleware to process ...
  4. url routing layer is a distribution layer, depending on the request information from the user, to perform a function corresponding view, the matching rules can be based on a regular or conventional text matching.
  5. View layer is written in our core business logic layer is divided into two kinds of CBV view and FBV view in Django. During the processing business logic you may need to use the data, which requires the use Django comes with the system to operate the database orm , get the data may have to return to the front end of a page, which requires the use of templates to render the Django, when the template is rendered and an end view of the layer function, returns the corresponding information Response
  6. Response will continue to return information through an intermediate layer for final processing of Response
  7. Finally, the data returned by the server wsgi information packed into line with HTTP protocol format back to the browser

Guess you like

Origin www.cnblogs.com/yscl/p/11575512.html