This is the code repository for Django 4 by Example, written by Antonio Melé and published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.
Django 4 by Example (4th edition) will guide you through the entire process of developing professional web applications with Django. The book not only covers the most relevant aspects of the framework, but it will also teach you how to integrate other popular technologies into your Django projects.
The book will walk you through the creation of four real-world applications, solving common problems, and implementing best practices, using a step-by-step approach that is easy to follow.
After reading this book, you will have a good understanding of how Django works and how to build practical, advanced web applications.
You’ll cover a wide range of web app development topics as you build four different apps:
-
Blog Application: Create a complete blog application using Django. Create data models, views, and URLs and implement an admin site for your blog. Create sitemaps and RSS feeds and implement a full-text search engine with PostgreSQL. Build a tagging system using django-taggit.
-
Social Website: Implement authentication with Facebook, Twitter, and Google using Python Social Auth. Create user profiles, image thumbnails with easy-thumbnails, build a JavaScript bookmarklet, create an activity stream, implement a user follow system and add infinite scroll pagination using Django and JavaScript.
-
Ecommerce Application: Build a product catalog, a shopping cart, and asynchronous tasks with Celery and RabbitMQ. Process payments with Stripe and manage payment notifications via webhooks. Generate PDF invoices using Weasyprint and export orders to CSV.
-
eLearning Platform: Create a content management system that manages users, groups, and permissions. Build a REST API using Django REST Framework and implement a real-time chat using WebSockets and Django Channels. Create a production environment using Docker Compose, Nginx, uWSGI and Daphne.
[Work in progress] Main Chapter folders contain only the finished code for each chapter. Additional folders contain the files as they appear for a given stage of each chapter.
Where there are interim files for the chapter, you can find those files in the chXX
folder within a sub-folder for each section. Where the edit to a particular file brings it in line with the final version, that file is not included in the interim tree.
Changed lines are marked with a comment. Where an entire block is new or changed, there is a hashtag on the line following the end of changed lines.
Filenames like filename_00.py
are the auto-generated files before any edits are applied, they exist for informational purposes only.
Join the book Discord Community to participate in the ongoing discussions or/and initiate a new one. You will find other developers reading the book alongside and helping each other with questions.
While the 4th edition of the book is translated to other languages, you can find translations for the previous editions:
- Simplified Chinese: Django 3项目实例精解
- Brazilian Portuguese: Aprenda Django 3 com Exemplos
- Polish: Django 3. Praktyczne tworzenie aplikacji sieciowych. Wydanie III
- Serbo-Croatian-Bosnian: Django 3 kroz primere, prevod III izdanja
- Spanish: Django 2
- Russian: Django 2 в примерах