Converting templates to jinja2, getting auth stuff working