Django 5 for the Impatient Learn the Core Concepts of Django to Develop Python Web Applications

Learning Django can be a challenging and time-consuming activity without the right guidance. With hundreds of tutorials, loads of documentation, and unclear explanations out there, it’s easy to lose sight of what’s most important. This book stands out by teaching you how to use Django in just a few...

Full description

Bibliographic Details
Other Authors: Correa, Daniel, author (author), Lim, Greg, author
Format: eBook
Language:Inglés
Published: Birmingham, England : Packt Publishing Ltd [2024]
Edition:Second edition
Subjects:
See on Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009853434906719
Table of Contents:
  • Cover
  • Title Page
  • Copyright and Credits
  • Contributors
  • Table of Contents
  • Preface
  • Preface
  • Chapter 1: Installing Python and Django, and Introducing the Movies Store Application
  • Technical requirements
  • Introducing and installing Python
  • Introducing and installing Django
  • Creating and running a Django project
  • Understanding the Movies Store application
  • Introducing the Django MVT architecture
  • Summary
  • Chapter 2: Understanding the Project Structure and Creating Our First App
  • Technical requirements
  • Understanding the project structure
  • The moviesstore folder
  • manage.py
  • db.sqlite3
  • Creating our first app
  • Creating a home page
  • Configuring an URL
  • Creating an about page
  • Configuring the about URL
  • Defining about function
  • Creating about template
  • Summary
  • Chapter 3: Designing a Base Template
  • Technical requirements
  • Creating a base template with Bootstrap
  • Introducing Bootstrap
  • Introducing Django template language (DTL)
  • Creating a base template
  • Registering the base template
  • Updating the home page to use the base template
  • Creating the new index template
  • Creating a custom CSS file
  • Storing an image
  • Serving the static files
  • Updating the base template to use the custom CSS and load static files
  • Updating the views index function
  • Updating the About page to use the base template
  • Creating the new About template
  • Storing the about.jpg image
  • Updating the views about function
  • Adding a header section
  • Updating the base template
  • Storing the logo image
  • Updating the style.css
  • Adding a footer section
  • Updating the base template
  • Updating the style.css
  • Summary
  • Chapter 4: Creating a Movies App with Dummy Data
  • Technical requirements
  • Creating the movies app
  • Creating the movies app
  • Adding the movies app to settings.
  • Including the movies URL file in the project-level URL file
  • Listing movies with dummy data
  • Configuring the movies URL
  • Defining the views index function
  • Creating a movies index template
  • Listing individual movies
  • Configuring individual movies URLs
  • Defining the views show function
  • Creating a movies show template
  • Adding individual movie links on the movies page
  • Adding a link in the base template
  • Summary
  • Chapter 5: Working with Models
  • Technical requirements
  • Creating our first model
  • Creating a Movie model
  • Installing Pillow
  • Managing migrations
  • Applying the default migrations
  • Creating custom migrations
  • Applying custom migrations
  • Accessing the Django admin interface
  • Creating a superuser
  • Restoring your superuser password
  • Accessing the admin panel
  • Configuring image upload
  • Serving the stored images
  • Adding a movie model to the admin panel
  • Adding the Movie model to the admin panel
  • Summary
  • Chapter 6: Collecting and Displaying Data from the Database
  • Technical requirements
  • Removing the movies' dummy data
  • Updating the movie listings page
  • Updating index function
  • Updating the movies.index template
  • Adding a custom CSS class
  • Updating the listing of an individual movie page
  • Updating show function
  • Updating the movies.show template
  • Adding a custom CSS class
  • Implementing a search movie functionality
  • Updating the movies.index template
  • Updating index function
  • Summary
  • Chapter 7: Understanding the Database
  • Technical requirements
  • Understanding the database viewer
  • Customizing the Django admin panel
  • Ordering movies by name
  • Allowing searches by name
  • Switching to a MySQL database
  • Configuring the MySQL database
  • Configuring our project to use the MySQL database
  • Running the migrations
  • Summary.
  • Chapter 8: Implementing User Signup and Login
  • Technical requirements
  • Creating an accounts app
  • Creating an accounts app
  • Adding the accounts app to the settings file
  • Including the accounts URL file in the project-level URL file
  • Creating a basic signup page
  • Configuring a signup URL
  • Defining the signup function
  • Creating accounts signup template
  • Adding the signup link to the base template
  • Improving the signup page to handle POST actions
  • Customizing UserCreationForm
  • Creating CustomUserCreationForm
  • Updating the signup function to use CustomUserCreationForm
  • Customizing the way errors are displayed
  • Creating a login page
  • Configuring a login URL
  • Defining login function
  • Creating accounts login template
  • Adding the link to the base template
  • Redirecting a registered user to the login page
  • Implementing a logout functionality
  • Configuring a logout URL
  • Defining the logout function
  • Adding the link to the base template
  • Summary
  • Chapter 9: Letting Users Create, Read, Update, and Delete Movie Reviews
  • Technical requirements
  • Creating a review model
  • Create the review model
  • Apply migrations
  • Add the review model to the admin panel
  • Creating reviews
  • Updating the movies.show template
  • Defining the create_review function
  • Configuring the create review URL
  • Reading reviews
  • Updating the movies.show template
  • Updating the show function
  • Updating a review
  • Updating movies.show template
  • Creating the movies edit_review template
  • Defining the edit_review function
  • Configuring the edit_review URL
  • Deleting a review
  • Updating the movies.show template
  • Defining the delete_review function
  • Configuring the delete_review URL
  • Summary
  • Chapter 10: Implementing a Shopping Cart System
  • Technical requirements
  • Introducing web sessions.
  • HTTP protocol limitations
  • Web sessions
  • Django login scenario
  • Django sessions
  • Creating a cart app
  • Adding cart app in settings
  • Including the cart URL file in the project-level URL file
  • Adding movies to the cart
  • Configuring the add_to_cart URL
  • Defining add_to_cart function
  • Updating the movies.show template
  • Listing movies added to the cart
  • Configuring cart index URL
  • Defining a utils file
  • Defining a filter
  • Defining an index function
  • Creating the cart.index template
  • Updating the add_to_cart function
  • Adding a link in the base template
  • Removing movies from the cart
  • Configuring clear URL
  • Defining clear function
  • Updating the cart.index template
  • Summary
  • Chapter 11: Implementing Order and Item Models
  • Technical requirements
  • Analyzing store invoices
  • Creating the order model
  • Creating the Order model
  • Applying migrations
  • Adding the order model to the admin panel
  • Creating the Item model
  • Creating the Item model
  • Applying migrations
  • Adding the item model to the admin panel
  • Recapping the Movies Store class diagram
  • Summary
  • Chapter 12: Implementing the Purchase and Orders Pages
  • Technical requirements
  • Creating the purchase page
  • Configuring the purchase URL
  • Defining the purchase function
  • Updating cart.index template
  • Creating cart.purchase template
  • Creating the orders page
  • Configuring the orders URL
  • Defining the orders function
  • Creating accounts.orders template
  • Adding a link in the base template
  • Recapping the Movies Store MVT architecture
  • Summary
  • Chapter 13: Deploying the Application to the Cloud
  • Technical requirements
  • Managing GitHub and Git
  • Understanding Git and GitHub
  • Creating a GitHub repository
  • Uploading our code to GitHub
  • Cloning your code onto PythonAnywhere
  • Configuring virtual environments.
  • Setting up your web app
  • Configuring static files
  • Summary
  • Index
  • Other Books You May Enjoy.