Two Scoops Press

Making Python and Django as fun as ice cream

Two Scoops of Django: Best Practices for Django 1.6

Two Scoops Press

$ 14.95 $ 64.95

Just out: Two Scoops of Django 1.11, expanded and revised for the latest version of Django!

This book is chock-full of material that will help you with your Django projects.

We’ll introduce you to various tips, tricks, patterns, code snippets, and techniques that we’ve picked up over the years. This book is a significant revision of the previous edition:

  • Expanded and revised. 446 pages total (up from 310 pages).
  • Significant portions of the previous material have been revised, incorporating huge amounts of feedback from our readers and our 1.6 technical reviewers. We listened to your suggestions, answered your questions, thought hard about your discussions and debates, and incorporated your useful tips into the book, carefully curating what went in and what didn't.
  • New material includes 6 chapters and 2 appendices covering function-based views, consuming REST APIs, deployment, continuous integration, i18n, new settings/config strategies and more.
  • Even more handy reference tables and lists, for at-a-glance comparisons and summaries.
  • Greatly improved index to make it easier to reference.

Also available from:

The India Edition is available only in India, it's available from these marketplaces for Rs. 1299:

We're still exploring distribution in other countries, including Australia, Asia, and South America. See our FAQ for details.

What have people said about Two Scoops of Django?

  • I read the first edition cover to cover. The second one raises the bar again. It's pedagogical, entertaining, and thoughtful. ~ Aymeric Augustin, Django core developer.
  • Whether you're a Django beginner or a seasoned veteran, I recommend you get this book, and read it cover to cover, and keep it near you for easy reference ~ Ken Cochrane, Django developer since 2008
  • It’s basically a 446 page checklist to getting your Django code right ~ Kevin A Stone, author of the Django Rest Framework and Angular Tutorial
  • One reason why using Django better than rails or some node framework is because of @pydanny and @audreyr's 2 scoops book! What a reference! ~ Lakshman Prasad, senior python developer, educator, and speaker
  • A great book! ~ Shawn Plummer, Django Developer
  • Make sure you have your favorite project next to you while reading. You'll be doing some rewriting. ~ Bryan Veloso, GitHubber, PyCon PH Keynote speaker
  • If I could time travel, the first thing I'd do would be give my younger self a copy of this book, and make him read it. ~ Randall Degges, Passionate Python Hacker
  • You know those lessons you learn when projects blow up in your face? This book contains several projects worth of such lessons. ~ Lennart Regebro, author of "Porting to Python 3"
  • This book should prove to be an amazing resource for any new-to-Django developer that picks it up. ~ Kenneth Love, Creator of "Getting Started with Django"
  • <3 <3 <3 ~ Jannis Leidel, Django Core Contributor
  • A single read-through of Two Scoops of Django gave me so many lightbulbs and tips; I had to go back for a second helping. ~ Lynn Root, Red Hat engineer and PyLadies ambassador.
  • Ha ha, I learned something in the first chapter. Awesome. ~ Zed Shaw, Author of Learn Python the Hard Way.
  • Two Scoops should provide some food for thought and usable recommendations for anybody using Django regularly. ~ Malcolm Tredinnick, Django Core Contributor
  • No matter what your skill level is, Two Scoops has solid tips for everyone. ~ Jeff Triplett, Developer at Revsys
  • This book is pure gold. If you're starting your Django adventure then buy this book. It will help you land your job. If you are experienced Django programmer, then buy this book. You will learn new things and question some other. It is that great. ~ Tomasz Paczkowski, DjangoCon Europe Co-organizer
  • This is the book I wished had existed and I could have read when I started learning Django. ~ Barry Morrison, Linux systems engineer and Django developer
  • I find analogies are very helpful for my understanding and the ice cream one is perfect. ~ Wifarley on Hacker News
  • Two Scoops of Django is by far the best Django book I've read. ~ Ben Beecher on Twitter
  • The writing is clear, concise, and accurate. This might be the best Django book I've read. ~ Jessica Ross
  • Are there any negatives? Well yes. Only one: I wish I've read it earlier! ~ Branko Vukelic
  • Thanks for writing the book - I learned quite a few new things from it and I have been using Django since 0.92. ~ Phil Davis

What does the book cover?

Two Scoops of Django covers common best practices, including the following:

Table of Contents

Here is a snapshot of the table of contents from Two Scoops of Django: Best Practices for Django 1.6.

  • Chapter 1: Coding Conventions
  • Chapter 2: The Optimal Django Environment Setup
  • Chapter 3: How to Lay Out Django Projects
  • Chapter 4: Fundamentals of Django App Design
  • Chapter 5: Settings and Requirements Files
  • Chapter 6: Database/Model Best Practices
  • Chapter 7: Function- and Class-Based Views
  • Chapter 8: Best Practices for Function-Based Views
  • Chapter 8: Best Practices for Class-Based Views
  • Chapter 10: Common Patterns for Forms
  • Chapter 11: More Things to Know About Forms
  • Chapter 12: Templates: Best Practices
  • Chapter 13: Template Tags and Filters
  • Chapter 14: Building REST APIs in Django
  • Chapter 15: Consuming REST APIs in Templates
  • Chapter 16: Tradeoffs of Replacing Core Components
  • Chapter 17: Working With the Django Admin
  • Chapter 18: Dealing with the User Model
  • Chapter 19: Django's Secret Sauce: Third-Party Packages
  • Chapter 20: Testing Chapter of Doom!
  • Chapter 21: Documentation: Be Obsessed
  • Chapter 22: Finding and Reducing Bottlenecks
  • Chapter 23: Security Best Practices
  • Chapter 24: Logging: What's It For, Anyway?
  • Chapter 25: Signals: Use Cases and Avoidance Techniques
  • Chapter 26: What About Those Random Utilities?
  • Chapter 27: Deployment: Platforms as a Service
  • Chapter 28: Deploying Django Projects
  • Chapter 29: Identical Environments: The Holy Grail
  • Chapter 30: Continuous Integration
  • Chapter 31: How To Release Your Own Django Packages
  • Chapter 32: Closing Thoughts
  • Appendix A: Packages Mentioned in This Book
  • Appendix B: Troubleshooting
  • Appendix C: Additional Resources
  • Appendix D: Internationalization and Localization
  • Appendix E: Settings Alternatives
  • Appendix F: Working with Python 3
  • Acknowledgments
  • Index

Why We Wrote This Book

After seeing other fellow developers struggle to get past the same sorts of basic hurdles in Django we had to overcome, we realized that much of the Django knowledge that we take for granted is not written down with examples anywhere.

We decided to take everything we know and write it down. Along the way, we learned even more from others and wrote those things down as well.

Find Any Errors?

Please check to see if your errors are already listed on the errata page. If not, let us know by filing issues here.

Questions or Problems?

We're listening. Please read the FAQ first, then email us if you still have a question or concern.

Enough Already! How Do I Purchase the Book?

Choose from these options:

  • For an autographed copy (limited quantity available), click Add to cart at the top of this page.
  • For a non-autographed copy, order it here on
  • For bulk (15+) orders, order from the wholesale order page for a discount and free international shipping.