Look Inside the book

In this book we introduce you to the various tips, tricks, patterns, code snippets, and techniques that we’ve picked up over the years. We have put thousands of hours into the fourth edition of the book, writing and revising its material to include significant improvements and new material based on feedback from previous editions.
  • 35 Chapter
  • Explained in a humorous and down to earth style
  • Clear examples to aid understanding
  • Best practices based on feedback from previous editions
Purchase on Amazon

Why Python

The language is open source and free to use for everyone, even for commercial projects and applications.

Readable Syntax

Moreover, the code is relatively easy to read since it somewhat resembles everyday English. This makes it easier to type than some other languages, too.


Over 130k packages to jump start your own projects: data science, machine learning, web development, game development, and more.

"My favorite language for maintainability is Python. It has simple, clean syntax, object encapsulation, good library support, and optional named parameters."

Full Chapter Overview

Here are all 35 chapters listed including the appendix.

Chapter 1: Coding Style

Every language has a style, python is no exception. If you know python, Django should feel very familiar.

Chapter 2: The Optimal Django Environment Setup

You’ll want to use a virtual environment to keep dependency versioning a sane process.

Chapter 3: How To Lay Out Django Projects

Even if you are a sole developer, having structure in your projects will keep you sane.

Chapter 4: Fundamentals of Django App Design

High level overview of Django design.

Chapter 5: Settings and Requirements Files

You’re going to deploy eventually, then read this.

Chapter 6: Model Best Practices

Python is object oriented, so pay attention to this chapter.

Chapter 7: Queries and the Database Layer

Not all projects will need a database, but if you do…

Chapter 8: Function- and Class-Based Views

One of the benefits of Django, batteries are included, and here’s how.

Chapter 9: Best Practices for Function-Based Views

Need a basic function, we go you covered.

Chapter 10: Best Practices for Class-Based Views

Class based views make development faster.

Chapter 11: Form Fundamentals

The last thing you want is opening a security exploit through your forms.

Chapter 12: Common Patterns for Forms

From clever to genius, you’ll want to read this.

Chapter 13: Templates: Best Practices

You might not need a node based frontend. Django has an excellent templating system.

Chapter 14: Template Tags and Filters

The magic of interpolation through tags. And filters just make things easy.

Chapter 15: Django Templates and Jinja2

Pass variables back and forth without needing an API.

Chapter 16: Building APIs with Django Rest Framework

Someone say API, keep reading…

Chapter 17: Consuming REST APIs

That node frontend might just come in handy now.

Chapter 18: Tradeoffs of Replacing Core Components

Dipping into the core files now? Let me upgrade your sippy cup to an actual cup.

Chapter 19: Working With the Django Admin

Great admin interface, but it’s only for admins!

Chapter 20: Dealing with the User Model

Don’t mess with the default user model, or you can after reading this chapter.

Chapter 21: Django’s Secret Sauce: Third-Party Packages

One-hundred-thirty-thousand third-party packages…! We’ll only go over the most popular for now.

Chapter 22: Testing Chapter of Doom!

Always test, no exceptions!

Chapter 23: Documentation: Be Obsessed

Remember how you got to where you got.

Chapter 24: Finding and Reducing Bottlenecks

Tips for finding the slowdowns and other problems.

Chapter 25: Asynchronous Task Queues

Don’t make them wait.

Chapter 26: Security Best Practices

Unless you want to appear on the news…

Chapter 27: Logging: Tips and Tools

Log in a way that your wallet won’t hate you.

Chapter 28: Signals: Use Cases and Avoidance Techniques

Think event propagation in javascript.

Chapter 29: What About Those Random Utilities?

These might interest you.

Chapter 30: Deployment: Platforms as a Service

Take the work out of maintaining servers.

Chapter 31: Deploying Django Projects

You’ll deploy without issue, I know it.

Chapter 32: Continuous Integration

Fix issues before it hits the production servers.

Chapter 33: The Art of Debugging

Bugs hate this chapter.

Chapter 34: Where and How to Ask Django Questions

Or in other words, how to ask in Stackoverflow and not get banned.

Chapter 35: Closing Thoughts

You’ve got this far, and here are some thoughts to leave you with.

Appendix A: Packages Mentioned In This Book

Packages Mentioned In This Book

Appendix B: Troubleshooting


Appendix C: Additional Resources

Additional Resources

Appendix D: Internationalization and Localization

Internationalization and Localization

Appendix E: Settings Alternatives

Settings Alternatives

Appendix F: Working with Python 2

Working with Python 2

Appendix G: Channels and Websockets

Channels and Websockets

What people are saying

Top reviews from the United States

Testimonial author

Benjamin G. Jones

Best framework book in the business, well written and conscientiously updated

This is the best Django book out there, but that is not sufficient praise. It is the best framework book I have ever read – at 440 or so well indexed, well sorted pages, this book is exemplary of what it covers, what it doesn’t cover, what it reinforces, and what it allows you to skip and read later.

Testimonial author


It's all Been Said

After going through “Django for Beginners” by W.S. Vincent, having built Django projects at work and for friends, and being able to reference the official Django docs, I’ve started to re-read the book. It’s like a completely different book. Now that I have my way of doing something do I understand the authors’ suggestions for doing it better, correctly, or more efficiently.

Testimonial author

Steve Wehba

If you use Django, read this book

You could spend a good part of a lifetime learning all that this book can teach you. Read the book and enjoy the rest of your life!

Testimonial author

Science Geek

Great way to learn best practices

Every Django programmer should have this book. It is the go-to source for people who are no longer beginners, and need to figure out Django best practices. For instance, how should you lay out your project? How can you keep your secret keys secret while doing proper version control? Everything else being equal, should you load your business logic into your view or your model? And so on.

Testimonial author

Jeff Ammons

This is the best compendium of Django knowledge I've found

This is the best compendium of Django knowledge I’ve found. It’s a vital reference for anyone who’s not already a Django master, and probably still useful if you are.

Read it on your favorite device!

You can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.

Quickly Interact and Browse

Highlight, take notes, and search in the book


Contains real page numbers based on the print edition (ISBN 0692915729).

Enhanced Typesetting

Enhanced typesetting improvements offer faster reading with less eye strain and beautiful page layouts, even at larger font sizes.

Page Flip

Page Flip is a new way to explore your books without losing your place.

Purchase on amazon
Daniel and Audrey Roy Greenfeld

Daniel and Audrey Roy Greenfeld

- Technical Writers

Daniel Roy Greenfeld has been writing fiction professionally since 2014. His fantasy novels take you on fast-paced epic adventures through magical lands. Knights, mages, and Greek mythology-inspired gods fight for power, often resulting in death and destruction. Young squires in awkwardly-fitting armor and apprentice mages still learning spells are left to clean up the mess. Dryads talk to trees and negotiate with the dead. Youthful romances blossom, only to be interrupted by invasions by dark legions. Chivalry is alive, and love triumphs over race and class divisions. Daniel is also an experienced software professional and co-author of a series of Python web development books. He has given keynote speeches at numerous academic and professional Python and Django conferences around the world. Daniel has worked for NASA as a senior software engineer. He has authored various popular open-source utility libraries, which are in production use by thousands of organizations, including Fortune 500 companies.

Audrey Roy Greenfeld is best known for being a programmer. She created the popular Cookiecutter project templating tool in 2013, now open source on GitHub with over 10,000 stars. She is one of the primary authors of Cookiecutter Django, one of the most widely-used Django web application project templates. She graduated from MIT in 2005 with a degree in electrical engineering and computer science. Audrey also has a deep passion for fiction writing. Her Ambria series, co-written with her husband Daniel Roy Greenfeld, explores a magical world where a boy is forced to grow up suddenly and help his family fight dark forces. Audrey is also an artist. She paints, sculpts, and creates generative art. At one point she was a professional artist with a studio practice in San Francisco and a large client base. Her work has been featured in Wired, Technology Review, CNN, and the New York Times. She now makes art primarily for herself. Her art studio is currently in Los Angeles. Audrey has co-written 5 fantasy books and 4 technical books with Daniel Roy Greenfeld. She has also written and illustrated a children’s book.

What other items do customers buy after viewing Two-Scoops Django 1.11?

Expand on the principles learned in this book with additionally connected topics.