Try reusing https://docs.djangoproject.com/en/dev/topics/auth/#module-django.contrib.auth.views to greatest extent.