Skip to content

Adding a Webpage

Paige Maute edited this page Oct 13, 2021 · 9 revisions

How to add a webpage

  1. Create the html file under templates. Project pages and other sub pages will be in certain folders.

  2. Create the views class under django_project -> views.py the views class template_name should have the exact same html file name

class TestPage(TemplateView):

template_name = 'test.html'`

class TestPage(TemplateView):
    template_name = 'test.html'
  1. Create the path for the webpage in django_project > urls.py then under urlpatterns add the path using the same exact name you used for the views class

  2. Then you are set to add the webpage where you want "{% url 'example' %}"

Clone this wiki locally