authens/example_site/example/views.py

13 lines
301 B
Python
Raw Normal View History

2020-05-11 00:34:11 +02:00
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")