This pattern gets repeated a lot. It would be cool if there was something like 'html_or_json(request, template, context, code=200)' or something.