Full-Stack Web Development with Python and Django
A hands-on guide to building robust, scalable web applications with Python and Django from project setup to production deployment
-
- $27.99
-
- $27.99
Publisher Description
Build production-ready Django applications from the ground up — covering models, APIs, authentication, background tasks, containerisation, and cloud deployment in one comprehensive guide
Python and Django remain the most productive combination for building serious web applications — but learning the framework is only half the battle. Knowing how to structure a project for long-term maintainability, secure it against real-world threats, optimise it under load, and ship it reliably to production is what separates working code from production-grade software.
This book takes you through the complete lifecycle of a Django application. You will start by setting up a professional development environment and understanding how Django's components fit together. From there, you will build a fully functional application layer by layer — designing models and writing migrations, creating function-based and class-based views, building REST APIs with Django REST Framework, handling file uploads securely, and integrating a JavaScript frontend that communicates with your API.
As the application grows, you will add the infrastructure that production systems require. You will configure Redis for caching and session management, offload slow work to Celery background tasks, write a comprehensive test suite with full code coverage measurement, and harden the application against SQL injection, XSS, CSRF, and other common vulnerabilities. The final chapters walk through deploying to a Linux server with Nginx and Gunicorn, containerising the entire stack with Docker Compose, and setting up monitoring, structured logging, and real-time error tracking so you know immediately when something goes wrong.
By the end of this book, you will have built and deployed a complete full-stack Django application and will have the skills and patterns to apply the same approach to any project you build next.
Key Features
Build a complete full-stack web application with Django, PostgreSQL, Redis, and Celery from scratch to production deployment
Master Django REST Framework to create secure, well-documented APIs consumed by a JavaScript frontend
Deploy containerised Django applications with Docker, Nginx, and Gunicorn while implementing real-world monitoring, logging, and error tracking with Sentry
What you will learn
Structure Django projects for scalability using an app-based architecture and environment-specific settings
Design relational database models with PostgreSQL and write migrations that are safe to run in production
Build REST APIs with Django REST Framework including serialisers, authentication, permissions, throttling, and pagination
Cache views, querysets, and template fragments with Redis and manage user sessions efficiently at scale
Process background work reliably with Celery and Redis, including retry logic, periodic scheduling, and production monitoring
Write unit tests, integration tests, and API tests using Django's test client and factory_boy, and measure coverage with coverage.py and many more...
Who this book is for
This book is for Python developers who know the basics of the language and want to build real web applications with Django. You should be comfortable writing Python functions and classes and have a basic understanding of how HTTP works — no prior Django experience is required. Developers who have built simple Django projects and want to understand how to structure, test, secure, and deploy them properly will find the later chapters particularly valuable. The book assumes no prior knowledge of PostgreSQL, Redis, Docker, or Linux server administration — each tool is introduced from scratch with working examples.