1 from django
.contrib
.auth
import views
as auth_views
2 from django
.http
import HttpResponse
, HttpResponseRedirect
4 from accounts
.forms
import AuthenticationForm
7 return auth_views
.login(request
, template_name
='accounts/login.html', authentication_form
=AuthenticationForm
)
10 return auth_views
.logout(request
, next_page
='/')
13 if not request
.user
.is_authenticated():