Django Web Development Books
Django 4.0
Django for Beginners: Build websites with Python and Django
Django for Beginners is a project-based introduction to Django, the popular Python-based web framework. Suitable for total beginners who have never built a website before as well as professional programmers looking for a fast-paced guide to modern web development and Django fundamentals.
In the book you’ll learn how to:
- Build 5 websites from scratch, including a Blog and Newspaper
- Deploy online using security best practices
- Customize the look and feel of your sites
- Write tests and run them for all your code
- Integrate user authentication, email, and custom user models
- Add permissions and authorizations to make your app more secure
Table of Contents
- Introduction
- Chapter 1: Initial Set Up
- Chapter 2: Hello World App
- Chapter 3: Pages App
- Chapter 4: Messsage Board App
- Chapter 5: Blog App
- Chapter 6: Forms
- Chapter 7: User Accounts
- Chapter 8: Custom User Model
- Chapter 9: User Authentication
- Chapter 10: Bootstrap
- Chapter 11: Password Change and Reset
- Chapter 12: Email
- Chapter 13: Newspaper App
- Chapter 14: Permissions and Authorization
- Chapter 15: Comments
- Chapter 16: Deployment
- Conclusion
Boost Your Django DX
During my years working with Django, I’ve picked up many tools and techniques to boost my Developer Experience, or DX. This book covers as many of these as possible, so you can learn them too!
Contents
The book contains 12 chapters.
Below is a brief summary of the contents - for a complete breakdown see the release post.
- OriginOpening notes, a description of the included examples, acknowledgements, changelog.
- DocumentationTools to get you to the right documentation, quicker. Covers DevDocs, DuckDuckGo, Bonus Django Documentation Sites, Wget, and some miscellaneous tips.
- Virtual Environments and DependenciesManage environments, and the dependencies within, correctly and easily. Covers venv, virtualenv, pip-tools, pip-lock, recommended practices for dependency management, and Python’s development mode.
- Python ShellEnhance your Python command line experience. Covers IPython and django-read-only.
- Development ServerMake Django’s
runserver
better. Covers django-debug-toolbar, Watchman, django-browser-reload, and Rich. - Code Quality ToolsThe key tools to improve your code quality. Covers EditorConfig, pre-commit, Black, isort, and Flake8.
- Further Code Quality ToolsMany extra tools useful for Django development. Covers pyupgrade, django-upgrade, pre-commit-hooks, reorder_python_imports, curlylint, DjHTML, Mypy (barely!), Prettier, ESLint, and Shellcheck.
- Build Your Own ToolsHow to make your own code quality tools. Covers pre-commit’s virtual languages, how to write and test a Flake8 plugin, and how to write a pre-commit-compatible command line tool.
- SettingsTips and patterns for managing Django’s settings file. Covers structuring your settings, a template, some patterns to avoid, and testing settings files.
- Models and MigrationsTips and tools for managing your data. Covers writing a management command to seed your development database, generating data with Factory Boy, migration safeguard practices, and django-linear-migrations.
- System ChecksMake the most of Django’s built-in runtime code quality framework. Covers how system checks work, how to write and test your own checks, and django-version-checks.
- TerminusClosing notes with links to further reading, including many things that didn't make it into the book.
Django for APIs: Build web APIs with Python and Django
Django for APIs is a project-based guide to building modern web APIs with Django & Django REST Framework. It is suitable for beginners who have never built an API before as well as professional programmers looking for a fast-paced introduction to Django fundamentals and best practices.
Over the course of 200+ pages you'll learn how to set up a new project properly, how web APIs work under the hood, and advanced testing and deployment techniques. Three separate projects are built from scratch with progressively more advanced features including a Library API, Todo API, and Blog API. User authentication, permissions, documentation, viewsets, and routers are all covered thoroughly.
Django for APIs is a best-practices guide to building powerful Python-based web APIs with a minimal amount of code.
Table of Contents
- Introduction
- Chapter 1: Initial Set Up
- Chapter 2: Web APIs
- Chapter 3: Library Website
- Chapter 4: Library API
- Chapter 5: Todo API
- Chapter 6: Blog API
- Chapter 7: Permissions
- Chapter 8: User Authentication
- Chapter 9: Viewsets and Routers
- Chapter 10: Schemas and Documentation
- Chapter 11: Production Deployment
- Conclusion
Django 3.2
Speed Up Your Django Tests
At the start of March I started writing a blog post called “How to Speed Up Your Django Tests”. Before I knew it, the outline alone was 4,000 words! I realized writing it up would be a major undertaking. As lockdown arrived, I found the time to write it all up.
So, I’m delighted to announce my new book, coming May 18…
Speed Up Your Django Tests!
It’s a practical guide to making your Django project’s tests faster. It has many tips and tricks that apply to all projects, big and small. And it covers the two most popular test runners: Django’s test framework and pytest.
Reducing test run time is the easiest and safest way to increase your speed of delivery. And it’s an organic way of increasing team happiness!
The content is based on my 8 years of experience with tests on Django projects. I’ve sped up many projects’ test suites, improved Django’s own testing framework, and created several pytest plugins.
It contains 13 chapters:
- Introduction - Opening notes, how to use the book.
- Toolbox - A tour of the various tools you can use to change how your tests run.
- Measure! - The importance of profiling, with walkthroughs using two different profilers on a test suite.
- Easy Wins - 11 things you can do in 5 minutes to speed up your test suite.
- Upgrades - The importance of upgrades, and some how-to guidance to get them done easily.
- Parallelize - How to use test suite parallelization to boost your tests.
- Migrations - Reduce the overhead of building your test database.
- Database Configuration - Tweak your database’s configuration to get more speed.
- CI Configuration - And tweak your CI configuration to boost test speed too.
- Test Structure - Notes on the best structure for fast, accurate tests, and ways you can restructure.
- Test Data - The best strategies for creating data in your tests.
- Targeted Mocking - A guide to mocking, and the best libraries for mocking out specific things such as HTTP requests and time.
- Outroduction - Closing notes with extra links.
Two Scoops of Django 3.x: Best Practices for the Django Web Framework
540+ pages, 519 while in Alpha
Once again, we're releasing a book chock-full of material that will help you with your Django projects!
In Two Scoops of Django we introduce you to various tips, tricks, patterns, code snippets, and techniques that we’ve picked up over the years. This book is an update and expansion of previous editions:
- Updated for Django 3.x (which will be maintained by the Django core team until at least April 2024!)
- Updated to match changes in the Django ecosystem, with corrections and clarifications added thanks to the feedback of our readers and technical reviewers.
- Updated for Python 3.8 and/or 3.9
- Revised material on nearly every topic within the book.
- New material on GraphQL, Django REST Framework, security, forms, models, and more.
Two Scoops of Django 3.x: Best Practices for the Django Web Framework is available in PDF now, possibly Kindle, ePub, and print formats later.
A Wedge of Django: Covers Python 3.8 and Django 3.x
A Wedge of Djangois a guided walkthrough tutorial where we build a real, production-quality Django web application from the ground up.
Originally a large part of our corporate training materials, this tutorial was once only available to companies paying $3000 a seat for in-person training. The contents of this book are professional-grade and have been used by real software companies to get their engineers up and running fast with Python 3.8 and Django 3.x development.
This book is designed to build solid foundations for any developer looking to get proficient with Django fast.
Django 3.1
Django for Professionals: Production websites with Python and Django
Django for Professionals takes your web development skills to the next level, teaching you how to build production-ready websites with Python and Django.
Once you have learned the basics of Django there is a massive gap between building simple "toy apps" and what it takes to build a "production-ready" web application suitable for deployment to thousands or even millions of users.
In the book you’ll learn how to:
- Build a Bookstore website from scratch
- Use Docker and PostgreSQL locally to mimic production settings
- Implement advanced user registration with email
- Write comprehensive tests
- Adopt advanced security and performance improvements
- Add search and file/image uploads
If you want to take advantage of all that Django has to offer, Django for Professionals is a comprehensive best practices guide to building and deploying modern websites.
Table of Contents
- Introduction
- Chapter 1: Docker
- Chapter 2: PostgreSQL
- Chapter 3: Bookstore Project
- Chapter 4: Pages App
- Chapter 5: User Registration
- Chapter 6: Static Assets
- Chapter 7: Advanced User Authentication
- Chapter 8: Environment Variables
- Chapter 9: Email
- Chapter 10: Books App
- Chapter 11: Reviews App
- Chapter 12: File/Image Uploads
- Chapter 13: Permissions
- Chapter 14: Search
- Chapter 15: Performance
- Chapter 16: Security
- Chapter 17: Deployment
- Conclusion
Django 3.0
Django 3 by Example
Django 3 Web Development Cookbook
About this book
Django is a web framework for perfectionists with deadlines, designed to help you build manageable medium and large web projects in a short time span. This fourth edition of the Django Web Development Cookbook is updated with Django 3's latest features to guide you effectively through the development process.
This Django book starts by helping you create a virtual environment and project structure for building Python web apps. You'll learn how to build models, views, forms, and templates for your web apps and then integrate JavaScript in your Django apps to add more features. As you advance, you'll create responsive multilingual websites, ready to be shared on social networks. The book will take you through uploading and processing images, rendering data in HTML5, PDF, and Excel, using and creating APIs, and navigating different data types in Django. You'll become well-versed in security best practices and caching techniques to enhance your website's security and speed. This edition not only helps you work with the PostgreSQL database but also the MySQL database. You'll also discover advanced recipes for using Django with Docker and Ansible in development, staging, and production environments.
By the end of this book, you will have become proficient in using Django's powerful features and will be equipped to create robust websites.