Event sourcing in Django

Posted on Thu 05 January 2017 in Django • Tagged with django, models, event sourcing, audit trail

Django comes with batteries included to make CRUD (create, read, update, delete) operations easy. But it also makes deleting data easy, causing you to lose historical data. Old data in your business critical models are valuable, and you never know when you'll want an audit trail. Use event sourcing to ensure you never lose your data's history.

Continue reading

3 ways of testing Django views

Posted on Mon 02 January 2017 in Django • Tagged with django, testing, views

I tried 3 different ways of testing a Django view. These are my thoughts.

Continue reading

Writing readable queries in Django

Posted on Sun 18 December 2016 in Django • Tagged with django, querysets

Queries in Django can get complicated and difficult to read. Here's how to write them in a way that doesn't confuse other programmers.

Continue reading