Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Django 5 for the Impatient

You're reading from   Django 5 for the Impatient Learn the core concepts of Django to develop Python web applications

Arrow left icon
Product type Paperback
Published in Sep 2024
Publisher Packt
ISBN-13 9781835461556
Length 228 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Greg Lim Greg Lim
Author Profile Icon Greg Lim
Greg Lim
Daniel Correa Daniel Correa
Author Profile Icon Daniel Correa
Daniel Correa
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Chapter 1: Installing Python and Django, and Introducing the Movies Store Application FREE CHAPTER 2. Chapter 2: Understanding the Project Structure and Creating Our First App 3. Chapter 3: Designing a Base Template 4. Chapter 4: Creating a Movies App with Dummy Data 5. Chapter 5: Working with Models 6. Chapter 6: Collecting and Displaying Data from the Database 7. Chapter 7: Understanding the Database 8. Chapter 8: Implementing User Signup and Login 9. Chapter 9: Letting Users Create, Read, Update, and Delete Movie Reviews 10. Chapter 10: Implementing a Shopping Cart System 11. Chapter 11: Implementing Order and Item Models 12. Chapter 12: Implementing the Purchase and Orders Pages 13. Chapter 13: Deploying the Application to the Cloud 14. Index 15. Other Books You May Enjoy

Understanding the Movies Store application

The use of running examples is a prevalent approach found in programming literature. The running example serves as a means to illustrate the principles of a methodology, process, tool, or technique. In this book, we will define a Movies Store running example. We will revisit this running example throughout the book to explain many of the Django concepts and elements in a practical way.

The Movies Store will be a web-based platform where users access information about movies and can place orders to purchase them.

Now, let’s outline the application’s scope for this particular app:

  • The Home page will feature a welcoming message.
  • The About page will provide details about the Movies Store.
  • The Movies page will exhibit information on available movies and include a filter to search movies by name. Additionally, users can click on a specific movie to view its details and post reviews.
  • The Cart page will showcase the movies added to the cart, along with the total price to be paid. Users can also remove movies from the cart and proceed with purchases.
  • The Register page will present a form enabling users to sign up for accounts.
  • The Login page will present a form allowing users to log in to the application.
  • The Orders page will display the orders placed by the logged-in user.
  • The Admin panel will encompass sections to manage the store’s information, including creating, updating, deleting, and listing information.

The Movies Store will be developed using Django (Python), with a SQLite database and Bootstrap (a CSS framework). Further details about these components will be covered in the forthcoming chapters.

In Figure 1.6, you’ll find a class diagram outlining the application’s scope and design. The user class is depicted with its associated data (such as an id, username, email, and password) and is capable of placing orders. Each order consists of one or more items, which are linked to individual movies. Each movie will possess its respective data (including an id, name, price, description, and image). Lastly, users have the ability to create reviews for movies.

Figure 1.6 – The Movies Store class diagram

Figure 1.6 – The Movies Store class diagram

This book does not delve into the intricacies of class diagrams; hence, we won’t elaborate on additional details within the diagram (you can refer to this link for additional information about class diagrams: https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-class-diagram-tutorial/). As you progress through the book, you’ll notice the correlation between code and this diagram. Serving as a blueprint, this diagram guides the construction of our application.

Note

Creating a class diagram before commencing coding aids in comprehending the application’s scope and identifying crucial data points. Additionally, it facilitates understanding the interconnections among various elements of the application. This diagram can be shared with team members or colleagues for feedback, allowing for adjustments as necessary. Due to its nature as a diagram, modifications can be implemented quickly. Otherwise, once the project has been coded, the cost of relocating data from one class to another increases significantly. Check the following statement from the book Building Microservices by Newman, S. (2015): “I tend to do much of my thinking in the place where the cost of change and the cost of mistakes is as low as it can be: the whiteboard.

Based on the previous scope, we will build a Movies Store app that will allow users to view and search for movies, as shown in Figure 1.7:

Figure 1.7 – The movies page with search functionality

Figure 1.7 – The movies page with search functionality

Users will be able to sign up, as shown in Figure 1.8:

Figure 1.8 – The Sign Up page

Figure 1.8 – The Sign Up page

Users will be able to log in, add movies to the cart, and make purchases, as shown in Figure 1.9:

Figure 1.9 – The shopping cart page

Figure 1.9 – The shopping cart page

Users will also be able to list, create, edit, and delete movie reviews, as shown in Figure 1.10:

Figure 1.10 – A specific movie page with its reviews

Figure 1.10 – A specific movie page with its reviews

Many other functionalities will be developed and explained across the book. Now, let’s see the architecture we will use to construct the Movies Store application.

You have been reading a chapter from
Django 5 for the Impatient - Second Edition
Published in: Sep 2024
Publisher: Packt
ISBN-13: 9781835461556
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime