Python Crash Course, 2nd Edition
Python作业代写 Embed all your theory answers, drawings, source codes and screenshots directly into this document. Always immediately after the
The aims of this exercise are to get started with Django framework and its routes, views and templates.
Please note that you should read about the second half of the chapter 18 “Getting Started with Django” of the course book “Python Crash Course, 2nd Edition” by Eric Matthes (2019) to complete the tasks of this exercise successfully.
Embed all your theory answers, drawings, source codes and screenshots directly into this document. Always immediately after the relevant question. In case you have your source code in a private git repository that is opened to your instructor, you can give direct links to your answers saved in a repository instead of embedding the answers.
Return the document into your return box in ItsLearning environment by the deadline. Please remember also to mark the number of points that you should get from this exercise according to your own evaluation. The maximum number of points available in this exercise is 10. You can check the task specific points directly from each task. Be prepared to present your solutions to other students during the demonstration lesson.
In addition to the course book it’s also recommendable to use other book and Internet sources to supplement the information.
The Tasks: Python作业代写
A web app called "Crazy Book Club" allows users to review the books they like. The home page of the club describes the site and invites users to either register or log in. Once logged in, a user can add new books, add new reviews, and read and edit existing reviews.
- Urls and routing (2 points)
- Create a file urls.py into the directory crazy_book_clubs. In that file, assign the app_name to crazy_books_clubs. Add the url pattern to the home page of the site. (0.5 points)
- Modify the urls.py file in the directory crazy_book_club so that it also refers the new file you just created above. (0.5 points)
- What are the responsibilities or tasks these files take care of? (2 * 0.5 = 1 point) Python作业代写
- Add a view to the Crazy Book Club Home Page (1 point)
- Write a view function for your site’s home page. (0.5 points)
- What is the purpose of this function? (0.5 points)
- Add a template to the Crazy Book Club Home Page (1 point)
- Write a template file for your site’s home page. (0.5 points)
- What is the purpose of this file? (0.5 points)
What is the routine for adding web pages into a Django application? What are the benefits of it? (2 * 0.5 = 1 point) Python作业代写
- Working with a parent template (2 points)
- Create a parent (base) template for your Crazy Book Club site. (0.5 points)
- What are the benefits of inheriting a parent template? (0.5 points)
- Modify your Home Page template so that it inherits from your parent template. (0.5 points)
- What is the benefit of using a url name in a template tag? (0.5 points)
- Implement two pages that display data: The page that lists all books and a page that displays all reviews for a particular book.
- Define urls for the book and the reviews pages. (2 * 0,5 = 1 point)
- Create views for the book and for the reviews pages. (2 * 0,5 = 1 point)
- Create child templates for the book and the reviews pages. (2 * 0,5 = 1 point)
- Take care that your site functions as a whole (add links, test). (1 point) Python作业代写