What is the difference between rewrite writing and direct rendering?
What is the difference between rewrite writing and direct rendering?
Return redirect ("login") # redirect to the login page with the status code 302
The difference between page redirection and direct rendering of new pages. Redirection actually points to another path, while direct rendering points to a page. Redirection updates the url in the browser, so that when users refresh the page, the new page is refreshed. Direct rendering does not update the url in the browser. When users refresh the page, the old url is refreshed. With redirection, views are executed at the backend. the corresponding function in py can be used to transmit parameters to the front-end. Direct rendering is to render the HTML file of the new page directly. If you want to transmit parameters, you must write the code that defines parameters in the function corresponding to the new page again in the function, and then pass the code, resulting in code redundancy.