Introduction to django2 routing configuration and rendering methods (pictures and text)

不言
Release: 2019-03-13 13:20:28
forward
2553 people have browsed it

This article brings you an introduction (pictures and text) about django2 routing configuration and rendering methods. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

<<>>

(1) First register the created app

(2) Configure routing

Create a new urls.py module in the app directory

Copy the contents of urls.py in the myproject directory into the module, and Import the view function

(3) Write the view function

Upload and run the project and access it in the browser

##[urls->View function->Front-end view]

<<>>

Name the url

Then import the redirection method

##Access 127.0.0.1:8000/myapp/login

Press Enter to enter the following page

##<<