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.»
The documentation is very slim when it talks about how to call a Django command from code. In order to do this, just use
call_command. To solve the trick of capturing the output of this I had to dig a little into the Django source.