login.py 500 B

1234567891011121314151617
  1. from django.http import HttpResponseRedirect
  2. from SharixAdmin.forms import LoginUserForm
  3. from django.contrib.auth.views import LoginView
  4. from django.urls import reverse_lazy, reverse
  5. from django.contrib.auth import logout
  6. def logout_view(request):
  7. logout(request)
  8. return HttpResponseRedirect(reverse('authweb'))
  9. class LoginSharix(LoginView):
  10. form_class = LoginUserForm
  11. template_name = 'SharixAdmin/auth.html'
  12. def get_success_url(self):
  13. return reverse_lazy('home')