In this assignment, you will use Django and Python to create a multi-page website which catalogues items on a topic of your choice. Pick a topic that you like, for example it could be books, movies, music, computer games, holiday destinations, etc.There should be at least 4 items in your catalogue and at most 10 items in a single catalogue. Exceeding the minimum of 4 simply allows you to get a better feel for how the website will look when it is fully populated with data. The user should be able to click on each item displayed in your catalogue, which will navigate them to a new page to view the details specific to that item.
The items from your website’s catalogue will need to be defined within your Python code, and displayed using Templates by passing the data to the Context for display. Do not hard code your catalogue items directly into your HTML.Task 1
For this task, your group is required to carefully complete the following requirements using Python and Django:
a. Create a website with at least these three pages.
Page 1: Home – A landing page (sometimes called a home page) that includes:
The names and student numbers of all members in your group.
A brief paragraph (a few sentences) that talks about your group’s chosen topic which you are cataloguing. E.g. “We chose to catalogue Widgets, because…”
Page 2: List – A page which displays a list of all the items in your catalogue. The list should show only the catalogue item’s name and a brief (or truncated) description of the catalogue item.
Page 3: Detail – A details page that displays all the specific information about that catalogue item. This page should be displayed when the user clicks on an item from your list page’s display.
b. You must be able to navigate to Page 1 and Page 2 from all locations within your website (using hyperlinks).
c. All requests for Page 3, regardless of the product selected, should be handled by a single entry in the urls.py file and its associated views.py function. This means that you should not have an entry in the urlpatterns list for every item in your catalogue. All urlpatterns entries you create must use RegEx syntax to define the URL.
d. Create and use a Python Class to structure the data for the items in your catalogue. Create multiple instances of your new Class object which represent the items in your catalogue, and store them in a list. For example:
item1 = My_Item_Class(‘widget’, ‘something’, ‘data’)
item2 = My_Item_Class(‘thingy’, ‘content’, ‘info’)
my_catalogue_list = [item1, item2]
e. Your Python Class should not be a child of any other Class, and should implement good Python standards and conventions for Classes. The Class must be defined in a separate file, and imported into your project’s other .py files where necessary.
f. Pass your catalogue list to the Context so the data can be rendered in the HTML Template. As mentioned above, for a single catalogue, there must be a minimum of 4 items and maximum of 10 items in your catalogue list.
g. Your website should use standard HTML5 syntax and make use of normal HTML formatting, such as headers, tables, hyperlinks and text formatting where appropriate.