Adding pages - AndersFelde/Django-template GitHub Wiki
Add a new page
-
create
page.htmlinwebpage/templates/webpage/ -
create
page.pyinwebpage/views/ -
add
path("page", page.page, name="page"), inwebpage/urls.py -
copy code from
index.pytopage.py- change index.html to page.html
- to send data, use
contextparameter inrender()
-
copy code from
index.htmltopage.html- change
titleto page - change value of active element to page
- hidden input element at the top
- change
-
change
webpage/templates/webpage/includes/navbar.html- add a new element in navbar