Two Scoops Press

Making Python and Django as fun as ice cream

Two Scoops of Django: Best Practices for Django 1.5

Two Scoops Press

$ 19.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 great for:

  • Beginning Django developers.
  • Developers with intermediate to advanced knowledge of Django who want to improve their Django projects.

This is the final release of the 1.5 book. We have put thousands of hours into writing and revising over 300 pages of concise, example-packed text. Also available is Two Scoops of Django 1.8.

Available from here as an e-book bundle containing PDF, EPUB, and MOBI formats. (Also available on in print format.)

Also available from:

What have people said about Two Scoops of Django?

  • 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.5.

  • 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 Class-Based Views
  • Chapter 9: Common Patterns for Forms
  • Chapter 10: More Things to Know About Forms
  • Chapter 11: Building REST APIs in Django
  • Chapter 12: Templates: Best Practices
  • Chapter 13: Template Tags and Filters
  • Chapter 14: Tradeoffs of Replacing Core Components
  • Chapter 15: Working With the Django Admin
  • Chapter 16: Dealing with the User Model
  • Chapter 17: Django’s Secret Sauce: Third-Party Packages
  • Chapter 18: Testing Chapter of Doom!
  • Chapter 19: Documentation: Be Obsessed
  • Chapter 20: Finding and Reducing Bottlenecks
  • Chapter 21: Security Best Practices
  • Chapter 22: Logging: What’s It For, Anyway?
  • Chapter 23: Signals: Use Cases and Avoidance Techniques
  • Chapter 24: What About Those Random Utilities?
  • Chapter 25: Deploying Django Projects
  • Chapter 26: How To Release Your Own Django Packages
  • Chapter 27: Closing Thoughts
  • Appendix A: Packages Mentioned in This Book
  • Appendix B: Troubleshooting
  • Appendix C: Additional Resources
  • 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?

While this edition is frozen, feedback from hundreds of readers made its way into the forthcoming 1.6 edition.

Can't Afford the Book?

If you’re struggling with finances and can’t afford it, let us know and we’d be happy to send you a free PDF of this 1.5 edition. Drop us a note at and we’ll try to get it to you within 72 hours.

Got Questions?

For more information, please read the FAQ.

Enough Already! How Do I Purchase the Book?