python

There is a war going on. A war between those that say Python requirements should be explicit and those that say requirements should be implicit. Before I continue, I’m going to be talking about requirements.txt, not setup.py. The difference between explicit and implicit requirements comes down to whether the line says Django==1.9.7 or Django, respectively.…

Read More requirements.txt==2.0

For years, my tool for simple load tests of HTTP sites has been ApacheBench. For years, my reference for how to visualize ApacheBench results has been Gnuplot For years, my reference for how to use Gnuplot has been http://www.bradlanders.com/2013/04/15/apache-bench-and-gnuplot-youre-probably-doing-it-wrong/ But do you really want to be writing Gnuplot syntax? It turns out that Pandas will…

Read More Apache Bench

Ren and Stimpy

[update: This post has been corrected, thanks to my commenters for your feedback] Every Django management command gets the verbosity option for free. You may recognize this: optional arguments: -h, –help show this help message and exit -v {0,1,2,3}, –verbosity {0,1,2,3} Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output We rarely use…

Read More Django management commands and verbosity

With 12factor style environment configs, it’s a very easy to accidentally connect to your production database when you think you’re connecting to dev. Here’s a simple guard you can add to make sure your  DATABASE_URL isn’t somehow pointed to someplace it’s not supposed to (assuming you’re using Amazon AWS): bash: if [[ ${DATABASE_URL} == *”amazonaws”*…

Read More Patterns: don’t mess up the prod db!