Blog posts

Django does not have a test server that supports HTTPS. But it is incredibly easy to create an HTTPS server that proxies to django test server; The tool to do this is stunnel.

To install on Arch Linux run pacman -S stunnel. I have not tested this on Ubuntu but apt-get install stunnel4 should do the trick.

Today I had the need to count all the lines of code in a django project. To start with I looked for a python script, then it occurred to me that seeing I'm on a *nix I should be doing this on the command line. So this is what I came up with:

find . -name "*.py" -type f -exec grep . {} \; | wc -l

This counts all the lines in the .py files in the current directory recursively. It does not count blank lines but it does count comments.