I would add all of this to `base.html` so that it is definitely always there. I commonly login from various pages on the site.