register: use ModelForm, and print all errors

This commit is contained in:
2023-10-31 21:14:24 +01:00
parent 54cc1b1705
commit a0c0d813b6
20 changed files with 203 additions and 258 deletions

15
accounts/views/logout.py Normal file
View File

@ -0,0 +1,15 @@
from django.shortcuts import render
from django.views import View
from django.http import HttpResponse, HttpRequest
from django.contrib.auth import logout
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from ..status_code import *
class LogoutView(View):
@method_decorator(login_required, name='dispatch')
def get(self, request: HttpRequest):
logout(request)
return HttpResponse(USER_LOGOUT)