Download project source code repository at:
https://github.com/playdoh888/youtube...
Important Notes and Links:
Steps to get the records in the database to the web pages
(Assuming you already have the model created):
(1) Update the "index" function in the application (rango)'s "views.py" module
The function will retrieve the records from database
then pass the retrieved records to the designated template by use a Python dictionary
(2) Update the template to use the Django template variable that was passed via "index" function.
Add the Category page to the site:
(1) Modify the "index,html" by use the "slug" attrubute in category object the to construct a "href"
while iterating through each object in the dictionary.
(2) While we got the "href", the link goes nowhere.
(3) Check the error message. It is giving us the hint.
(4) Need to add a new URL switch in the "rango" application "urls.py" file.
(6) With the "switch" statement in place, we need to add a function "category".
This is to tell URL switch what function to call when the link is clicked.