url(r'^accounts/login/$', auth_views.login, {'template_name': 'myapp/login.html'}),
def auth(request):
username = request.POST['login']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None and user.is_active:
login(request, user)
return HttpResponseRedirect(reverse('shop:index'))