authens/example_site/example/views.py
2020-05-11 00:36:59 +02:00

12 lines
301 B
Python

from django.contrib.auth.decorators import login_required
from django.shortcuts import render
def home(request):
ctx = {"user": request.user}
return render(request, "example/home.html", ctx)
@login_required
def protected_page(request):
return render(request, "example/protected.html")