Monitor performance issues & errors in your code

10 tips every Django developer should know

Episode #277, published Mon, Aug 10, 2020, recorded Sun, Jul 19, 2020

We recently covered 10 tips that every Flask developer should know. But we left out a pretty big group in the Python web space: Django developers! And this one is for you. I invited Bob Belderbos, who's been running his SaaS business on Python and Django for several years now, to share his tips and tricks.

The 10 tips

  1. Django Admin
  2. ORM magic
  3. Models
  4. Debugging/Performance Toolbar
  5. Extending the User model
  6. Class based views (CBVs)
  8. Write your own middleware
  9. Config variable management with python-decouple and dj-database-url
  10. Built-in template tags and filters

Links from the show

Bob on Twitter: @bbelderbos
Code Challenges Platform:

Django admin:
Django admin cookbook:
Use some Django ORM magic to get the most common first names:
Django custom manager:
Debug toolbar:
Extending the user model / working with signals / @receiver:
Class-based views:
Comparing class and function-based views:
Example of class-based views:
Django command template:
Django middleware example:

Config settings management:

Useful template tags and filters:

is_new filter example:
Asynchronous Tasks with Django and Celery:
Celery debugging - CELERY_ALWAYS_EAGER:

Extra tools Michael mentioned
BeeKeeper Studio:
Human time to Python parse string site (the one I forgot):
Episode transcripts:

--- Stay in touch with us ---
Subscribe to us on YouTube:
Follow Talk Python on Mastodon: talkpython
Follow Michael on Mastodon: mkennedy

Want to go deeper? Check out our courses

Talk Python's Mastodon Michael Kennedy's Mastodon