Skip to content

Adding pages

Anders Kvamme Felde edited this page Apr 2, 2021 · 4 revisions

Add a new page

  • create page.html in webpage/templates/webpage/

  • create page.py in webpage/views/

  • add path("page", page.page, name="page"), in webpage/urls.py

  • copy code from index.py to page.py

    • change index.html to page.html
    • to send data, use context parameter in render()
  • copy code from index.html to page.html

    • change title to page
    • change value of active element to page
      • hidden input element at the top
  • change webpage/templates/webpage/includes/navbar.html

    • add a new element in navbar

Clone this wiki locally