Skip to content

Instantly share code, notes, and snippets.

View ragnarok22's full-sized avatar
🏠
Working from home

Reinier Hernández ragnarok22

🏠
Working from home
View GitHub Profile
@ragnarok22
ragnarok22 / auth_views.py
Created September 2, 2016 14:01 — forked from stefanfoulis/auth_views.py
django: class based authentication view (login)
#-*- coding: utf-8 -*-
import urlparse
from django.contrib.auth import REDIRECT_FIELD_NAME, login
from django.contrib.auth.forms import AuthenticationForm
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_protect
from django.views.generic.edit import FormView
from django.conf import settings