7 Ways to Speed Up Your Django Test Suite

August 13, 2016

As your Django app grows larger, your test suite starts piling up. In a project I was working on we had a test suite of 375 tests. Today I'll explain how I reduced the run time of that suite from 350+ seconds to 20 seconds. 1. Mock, mock, mock! A HUGE bottleneck of our tests was in the billing logic. We had many tests that were actually hitting billing APIs (on test accounts of course, but s...

Super Simple Django Gravatar

June 30, 2016

Before turning to a django package for a new feature, it's sometimes a good idea to take a step back and look at how difficult it would actually be to do it yourself. Sometimes its easier to implement yourself rather than install a package for something simple. I noticed this with gravatar. Gravatar is a service for globally recognized avatars. Many times this is used in sites so that we don't ...

Django View Template Decorator

March 2, 2016

Recently I have been playing around with decorators in Python. Decorators are a really cool feature that allows you to add functionality to any function with a simple @decorator tag. It is very nice for injecting functionality to many functions that do similar things. A place where this can be applied effectively is in Django views. This past weekend I was at a hackathon working with a fairly s...

KnockoutJS Custom Double Click Binding

February 2, 2016

While working on a project the other day I was presented with an interesting issue. In our project we are using Knockout JS for 2-way data binding between a set of data and a Leaflet JS map. With all of this data, we have many different click events needed so the user can interact with and manipulate the data in different ways. I needed a way to have 2 different bindings on one item for both a ...