• Python 3
Reading time
  • Approximately 55 days
What you will learn
  • Web Development
  • Daniel Roy Greenfeld
  • 5 years ago
Packages you will be introduced to
  • django
Book cover of Two Scoops of Django 1.11: Best Practices for the Django Web Framework by Daniel Roy Greenfeld

Official description

Two Scoops of Django 1.11 Will Help You Build Django Projects.

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.

Table of Contents

  • 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
  • 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 APIs with Django Rest Framework
  • 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: Tips and Tools
  • 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 29: Identical Environments: The Holy Grail
  • Chapter 32: Continuous Integration
  • Chapter 33: The Art of Debugging
  • 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 2
  • Appendix G: Channels and Websockets

What People Say About Two Scoops of Django

  • This is the swiss army knife for every Django developer. -- Jannis Gebauer, maintainer and founder
  • We buy this book for every new engineer on our team. It's a must for Django development! -- Jacinda Shelly, CTO of Doctor On Demand
  • I wanted to write a book about best practices in Django, except Two Scoops is that book, no need to write another one. -- Buddy Lindsey, Host of GoDjango
  • Audrey's illustrations reinforce Audrey and Daniel's Django technical excellence. (Art + ice cream) * 2 tech experts = Two Scoops of Django. -- Carol Willing, Project Jupyter Core Dev and Python Software Foundation director
  • Simply the best book on Django. Whenever I am not sure if I am following the best practices, I look up the topic in this book. A must read. -- Abu Ashraf Masnun, programmer


There are 1 reviews for this book on GitHub.
gutfeeling left a review on GitHub 5 years ago.

Essential reading for Django developers

I read this book in 2014. At that time, I had already completed the Official Django Tutorials and knew how to code simple apps. However, I was not confident and couldn't handle more complex projects. I figured out a few things from the official documentation but was always worried that I was not following best practices in my own projects.

I picked up this book to get more confident with Django. I must say that the book was very effective in this regard. When I finished this book, I was confident and could advice others on how to organize a Django website. The authors cover important topics like how to use virtualenv, requirements file, different settings files for development and production, how to leverage model inheritance and class based views to stay DRY, security best practices, testing, deployment and much much more. The authors are recognized experts in Django, so that made me confident in the knowledge that I gained from the book.

Things I liked about this book

  • The book uses the example of an ice cream website throughout the book to illustrate the concepts. I really enjoyed the examples and could understand the concepts better in context.

  • The writing style is beautiful. The book is a pleasure to read.

Things I didn't like

  • The book probably went a little overboard with the DRY principle. I say this from experience as it encouraged me to make websites more complicated than they ought to be. However, this is not really a major downside as every book has its own angle and one needs to augment it with experience. None of the suggestions in the book are theoretically incorrect.

In summary, if you have a little bit of experience with Django and looking to solidify your knowledge or learn best practices, then this book is great. It's really an essential title in a Django developer's bookshelf because I don't think there's any other books with similar content. I recommend it wholeheartedly.

Write a review

Read this book? Comment on this book's GitHub issue page and share what you liked and what you didn't like about it. Your GitHub comment will show up as a review here.