Two Scoops Press

Making Python and Django as fun as ice cream

Two Scoops of Django: Best Practices for Django 1.8

Two Scoops Press

$ 24.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 an update and expansion of previous editions:

  • Updated for Django 1.8 and changes in the Django ecosystem, with corrections and clarifications added thanks to the feedback of our readers and technical reviewers.
  • Revised material on templates, consuming REST APIs, replacing core components of Django, and more.
  • 85+ pages of new material on Jinja2, debugging, advanced query tools, data validation, testing, security, and more.

Two Scoops of Django: Best Practices to Django 1.8 is available right now in print and PDF formats. The paperback is also available on Amazon,, and Flipkart and other online stores.

As we're certain you have many questions, we've written up a FAQ.

Reviews of Two Scoops of Django 1.8

What people have said about Two Scoops of Django:

  • On their first day at FanDuel each Python developer is given their own copy of Two Scoops of Django - it's the most distilled source of Django experience and wisdom that we've found.
  • The best book on Django. Period. - Kevin Xu, CEO & Founder, imHome
  • <3 <3 <3 ~ Jannis Leidel, Django Core Contributor
  • This book should prove to be an amazing resource for any new-to-Django developer that picks it up. ~ Kenneth Love, Python and Django instructor at Treehouse.
  • Even if you're already an experienced Django developer, this is great book to go over the best practices. ~ Bartek Ogryczak, Senior Python Engineer
  • 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
  • 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"
  • One reason why using Django is 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

What does the book cover?

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

Table of Contents

Here is the table of contents from Two Scoops of Django: Best Practices for Django 1.8.

  • Chapter 1: Coding Style
  • 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: Model Best Practices
  • Chapter 7: Queries and the Database Layer (NEW)
  • Chapter 8: Function- and Class-Based Views
  • Chapter 9: Best Practices for Function-Based Views
  • Chapter 10: Best Practices for Class-Based Views
  • Chapter 11: Form Fundamentals
  • Chapter 12: Common Patterns for Forms
  • Chapter 13: Templates: Best Practices
  • Chapter 14: Template Tags and Filters
  • Chapter 15: Django Templates and Jinja2
  • Chapter 16: Building REST APIs
  • Chapter 17: Consuming REST APIs
  • Chapter 18: Tradeoffs of Replacing Core Components
  • Chapter 19: Working With the Django Admin
  • Chapter 20: Dealing with the User Model
  • Chapter 21: Django's Secret Sauce: Third-Party Packages
  • Chapter 22: Testing Chapter of Doom!
  • Chapter 23: Documentation: Be Obsessed
  • Chapter 24: Finding and Reducing Bottlenecks
  • Chapter 25: Asynchronous Task Queues
  • Chapter 26: Security Best Practices
  • Chapter 27: Logging: What's It For, Anyway?
  • Chapter 28: Signals: Use Cases and Avoidance Techniques
  • Chapter 29: What About Those Random Utilities?
  • Chapter 30: Deployment: Platforms as a Service
  • Chapter 31: Deploying Django Projects
  • Chapter 32: Continuous Integration
  • Chapter 33: The Art of Debugging (NEW)
  • Chapter 34: Where and How to Ask Django Questions
  • Chapter 35: 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
  • Appendix G: Security Settings Reference
  • Acknowledgments
  • Index

Why We Wrote This Book Series

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.

Enough Already! Can I Order the Book?

Yes! Go to the top of this page and click the Add to cart button.