15 lines
484 B
Python
15 lines
484 B
Python
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) |