Article From:

1.Create app

1.1Stop running server first.

python startapp todolist (todolistApp name)


Run the server again

#Choose a good text editor, refer to another essay Sublime Text.


2.Registration app tells the server that app has been created.


installed_appAdd a row to the app name.



3.Create template folder for web page template

todolistRight click the new folder, named templates.


4.Create a home page


Create a new file –> home.html under the Templates folder


Create HTML template –> enter, then press tab key to complete.


5.Web site related websites


Setting up URL distribution in general routing

from django.contrib import admin
from django.urls import path, include
import todolist.urls

Import include —-> why?

Create sub routing in app

And divide the route into the general route.

5.2Controlling web address association in

from django.urls import path, include
from . import views   #why?

urlpatterns = [

path(”, views.home,)

5.3Control pages in views function

def home(request):
return render(request, “home.html”)


Link of this Article: The use of Django

Leave a Reply

Your email address will not be published. Required fields are marked *