views.py 414 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.shortcuts import render


def login(request):
    return render(request, 'um_django_ui/index.html')


@login_required
def logout(request):
    auth_logout(request)
    return HttpResponseRedirect(reverse('home'))