How to minify HTML output in Django

So, you want to compress the size of the HTML that Django generates? Here is the Django way to do it.

In order to do this, you’ll have to write a middleware for your application. Read the full article ...

How to set a variable in Django template

So, you need for some reason to set a variable inside a Django template? As you may have figured by now, Django does not implement such a feature. That is, because the logic of setting the variable must go in the view, not in the template. But there are some rare cases when you actually need this. Read the full article ...

Quicktip: capture the output of a Django command

So, you want to programmatically call a Django command, and then capture it’s output? The documentation is very slim when it talks about how to call a Django command from code. To call a Django command from code it’s easy: just use call_command. To solve the trick of capturing the output of this I had to dig a little intro the Django source. Read the full article ...