My Account Log in

1 option

Django 5 for the Impatient : Learn the Core Concepts of Django to Develop Python Web Applications / Daniel Correa and Greg Lim.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Correa, Daniel, author.
Lim, Greg, author.
Language:
English
Subjects (All):
Django (Electronic resource).
Web site development.
Web sites--Authoring programs.
Web sites.
Physical Description:
1 online resource (228 pages)
Edition:
Second edition.
Place of Publication:
Birmingham, England : Packt Publishing Ltd., [2024]
Biography/History:
Correa Daniel: Daniel Correa is a researcher, software developer, and author of programming books. Holding a PhD in computer science, he also serves as a professor at Universidad EAFIT in Colombia. His interests lie in software architectures, frameworks, web development, and clean code. Lim Greg: Greg Lim is a technologist and the author of several books on programming. He has taught programming in tertiary institutions for many years and places a strong emphasis on learning by doing.
Summary:
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 days with a focused approach. In this second edition, you’ll go on a fun, practical, and pragmatic journey to learning full-stack development with Django 5. You’ll start building your first Django app within minutes. As you progress, you’ll learn from concise explanations that will help you get to grips with some of the most important Django features, including URLs, views, templates, models, CSS inclusion, image storage, Django admin panel, and more. You’ll also understand how to design Django MVT (Model-View-Template) architectures and implement them. Additionally, you’ll use Django to develop a movie store application and deploy it to the internet. By the end of this book, you’ll be able to build and deploy your own Django web applications confidently.
Contents:
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
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
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
Chapter 3: Designing a Base Template
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
Chapter 4: Creating a Movies App with Dummy Data
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
Chapter 5: Working with Models
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
Chapter 6: Collecting and Displaying Data from the Database
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
Implementing a search movie functionality
Chapter 7: Understanding the Database
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
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
Chapter 9: Letting Users Create, Read, Update, and Delete Movie Reviews
Creating a review model
Create the review model
Apply migrations
Add the review model to the admin panel
Creating reviews
Defining the create_review function
Configuring the create review URL
Reading reviews
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
Defining the delete_review function
Configuring the delete_review URL
Chapter 10: Implementing a Shopping Cart System
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
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
Removing movies from the cart
Configuring clear URL
Defining clear function
Updating the cart.index template
Chapter 11: Implementing Order and Item Models
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
Adding the item model to the admin panel
Recapping the Movies Store class diagram
Chapter 12: Implementing the Purchase and Orders Pages
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
Recapping the Movies Store MVT architecture
Chapter 13: Deploying the Application to the Cloud
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
Index
Other Books You May Enjoy.
Notes:
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
9781835468333
1835468330
OCLC:
1461599673

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account