[Django]-Add a static html page in Django

7👍

✅

I would suggest you to use TemplateView for static page

from django.urls import path
from django.views.generic import TemplateView

urlpatterns = [
    path('about/', TemplateView.as_view(template_name="about.html")),
]

TemplateView should be used when you want to present some information
in a html page

TemplateView shouldn’t be used when your page has forms and does
creation or update of objects.

Leave a comment