My Account Log in

1 option

Django 5 by Example : Build Powerful and Reliable Python Web Applications from Scratch / Antonio Melé ; foreword by Paolo Melchiorre.

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

View online
Format:
Book
Author/Creator:
Mele, Antonio, author.
Contributor:
Melchiorre, Paolo, writer of foreword.
Series:
Expert insight.
Expert insight
Language:
English
Subjects (All):
Django (Electronic resource).
Web site development.
Web sites--Authoring programs.
Web sites.
Physical Description:
1 online resource (821 pages)
Edition:
Fifth edition.
Place of Publication:
Birmingham, England : Packt Publishing Ltd., [2024]
Biography/History:
Mele Antonio: Antonio Mele has been crafting Django projects since 2006, for clients spanning multiple industries. He is Engineering Director at Backbase, a leading global fintech firm dedicated to facilitating the digital transformation of financial institutions. He co-founded Nucoro, a digital wealth management platform. In 2009 Antonio founded Zenx IT, a company specialized in developing digital products. He has been working as CTO and consultant for several tech-centric startups. He has also managed development teams building projects for large enterprise clients. He has an MSc in Computer Science from Universidad Pontificia Comillas and completed the Advanced Management Program at MIT Sloan. His father inspired his passion for computers and coding.
Summary:
Django 5 By Example is the fifth edition of the best-selling franchise that helps you build real-world web apps. This book will walk you through planning and creation, solving common problems, and implementing best practices using a step-by-step approach. You’ll cover a wide range of web application development topics through four different projects: a blog application, a social website, an e-commerce application, and an e-learning platform. Pick up what’s new in Django 5 as you build end-to-end Python web apps, follow detailed project plans, and understand the hows and whys of Django. This is a practical and approachable book that will have you creating web apps quickly.
Contents:
Cover
Copyright
Foreword
Contributors
Table of Contents
Preface
Chapter 1: Building a Blog Application
Installing Python
Creating a Python virtual environment
Installing Django
Installing Django with pip
Django overview
Main framework components
The Django architecture
New features in Django 5
Creating your first project
Applying initial database migrations
Running the development server
Project settings
Projects and applications
Creating an application
Creating the blog data models
Creating the Post model
Adding datetime fields
Defining a default sort order
Adding a database index
Activating the application
Adding a status field
Adding a many-to-one relationship
Creating and applying migrations
Creating an administration site for models
Creating a superuser
The Django administration site
Adding models to the administration site
Customizing how models are displayed
Adding facet counts to filters
Working with QuerySets and managers
Creating objects
Updating objects
Retrieving objects
Filtering objects
Using field lookups
Chaining filters
Excluding objects
Ordering objects
Limiting QuerySets
Counting objects
Checking if an object exists
Deleting objects
Complex lookups with Q objects
When QuerySets are evaluated
More on QuerySets
Creating model managers
Building list and detail views
Creating list and detail views
Using the get_object_or_404 shortcut
Adding URL patterns for your views
Creating templates for your views
Creating a base template
Creating the post list template
Accessing our application
Creating the post detail template
The request/response cycle
Management commands used in this chapter
Summary
Additional resources.
Chapter 2: Enhancing Your Blog and Adding Social Features
Functional overview
Using canonical URLs for models
Creating SEO-friendly URLs for posts
Modifying the URL patterns
Modifying the views
Modifying the canonical URL for posts
Adding pagination
Adding pagination to the post list view
Creating a pagination template
Handling pagination errors
Building class-based views
Why use class-based views
Using a class-based view to list posts
Recommending posts by email
Creating forms with Django
Handling forms in views
Sending emails with Django
Working with environment variables
Sending emails in views
Rendering forms in templates
Creating a comment system
Creating a model for comments
Adding comments to the administration site
Creating forms from models
Handling ModelForms in views
Creating templates for the comment form
Adding comments to the post detail view
Adding comments to the post detail template
Using simplified templates for form rendering
Additional resources
Chapter 3: Extending Your Blog Application
Implementing tagging with django-taggit
Retrieving posts by similarity
Creating custom template tags and filters
Implementing custom template tags
Creating a simple template tag
Creating an inclusion template tag
Creating a template tag that returns a QuerySet
Implementing custom template filters
Creating a template filter to support Markdown syntax
Adding a sitemap to the site
Creating feeds for blog posts
Adding full-text search to the blog
Installing Docker
Installing PostgreSQL
Dumping the existing data
Switching the database in the project
Loading the data into the new database
Simple search lookups
Searching against multiple fields
Building a search view.
Stemming and ranking results
Stemming and removing stop words in different languages
Weighting queries
Searching with trigram similarity
Expanding your project using AI
Chapter 4: Building a Social Website
Creating a social website project
Starting the social website project
Using the Django authentication framework
Creating a login view
Using Django's built-in authentication views
Login and logout views
Change password views
Reset password views
User registration and user profiles
User registration
Extending the user model
Installing Pillow and serving media files
Creating migrations for the profile model
Using a custom user model
Chapter 5: Implementing Social Authentication
Technical requirements
Using the messages framework
Building a custom authentication backend
Preventing users from using an existing email address
Adding social authentication to your site
Running the development server through HTTPS
Authentication using Google
Creating a profile for users that register with social authentication
Chapter 6: Sharing Content on Your Website
Creating an image bookmarking website
Building the image model
Creating many-to-many relationships
Registering the image model in the administration site
Posting content from other websites
Cleaning form fields
Installing the Requests library
Overriding the save() method of a ModelForm
Building a bookmarklet with JavaScript
Creating a detail view for images
Creating image thumbnails using easy-thumbnails
Adding asynchronous actions with JavaScript
Loading JavaScript on the DOM.
Cross-site request forgery for HTTP requests in JavaScript
Performing HTTP requests with JavaScript
Adding infinite scroll pagination to the image list
Chapter 7: Tracking User Actions
Building a follow system
Creating many-to-many relationships with an intermediate model
Creating list and detail views for user profiles
Adding user follow/unfollow actions with JavaScript
Creating an activity stream application
Using the contenttypes framework
Adding generic relations to your models
Avoiding duplicate actions in the activity stream
Adding user actions to the activity stream
Displaying the activity stream
Optimizing QuerySets that involve related objects
Using select_related()
Using prefetch_related()
Creating templates for actions
Using signals for denormalizing counts
Working with signals
Application configuration classes
Using Django Debug Toolbar
Installing Django Debug Toolbar
Django Debug Toolbar panels
Django Debug Toolbar commands
Counting image views with Redis
Installing Redis
Using Redis with Python
Storing image views in Redis
Storing a ranking in Redis
Next steps with Redis
Chapter 8: Building an Online Shop
Creating an online shop project
Creating product catalog models
Registering catalog models on the administration site
Building catalog views
Creating catalog templates
Building a shopping cart
Using Django sessions
Session settings
Session expiration
Storing shopping carts in sessions
Creating shopping cart views
Adding items to the cart
Building a template to display the cart
Adding products to the cart
Updating product quantities in the cart.
Creating a context processor for the current cart
Context processors
Setting the cart in the request context
Registering customer orders
Creating order models
Including order models in the administration site
Creating customer orders
Creating asynchronous tasks
Working with asynchronous tasks
Workers, message queues, and message brokers
Using Django with Celery and RabbitMQ
Monitoring Celery with Flower
Chapter 9: Managing Payments and Orders
Integrating a payment gateway
Creating a Stripe account
Installing the Stripe Python library
Adding Stripe to your project
Building the payment process
Integrating Stripe Checkout
Testing the checkout process
Using test credit cards
Checking the payment information in the Stripe dashboard
Using webhooks to receive payment notifications
Creating a webhook endpoint
Testing webhook notifications
Referencing Stripe payments in orders
Going live
Exporting orders to CSV files
Adding custom actions to the administration site
Extending the administration site with custom views
Generating PDF invoices dynamically
Installing WeasyPrint
Creating a PDF template
Rendering PDF files
Sending PDF files by email
Chapter 10: Extending Your Shop
Creating a coupon system
Building the coupon model
Applying a coupon to the shopping cart
Applying coupons to orders
Creating coupons for Stripe Checkout
Adding coupons to orders on the administration site and to PDF invoices
Building a recommendation engine
Recommending products based on previous purchases
Chapter 11: Adding Internationalization to Your Shop
Functional overview.
Internationalization with Django.
Notes:
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
1-80512-234-7
OCLC:
1432732852

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