May 2020
Intermediate to advanced
404 pages
10h 52m
English
Let's now create a web page that loads when the / route is accessed. Remember the api app that we created in the project? Let's make the index page a part of this app for the sake of simplicity. While it is possible to create this route in the urls.py file of the mysite app, we will provide the api app with its own route handling file.
Let's begin with the steps for setting up the home page template:
from django.urls import pathfrom . import viewsurlpatterns = [ path('', views.indexView), # This line ...Read now
Unlock full access