Compare commits

..

2 commits

Author SHA1 Message Date
0e24c1d9ad Komentář k CSRF chybám 2023-10-09 22:04:01 +02:00
29b3271200 CSRF chyba má vrátit 403 2023-10-09 22:02:05 +02:00

View file

@ -1,10 +1,13 @@
from django.http import HttpResponseForbidden
from django.shortcuts import render
# Create your views here.
def csrf_error(request, reason):
""" Jednoduchý „template_view“ (třída to být nesmůže) pro CSRF chyby """
return render(
request, 'various/403_csrf.html',
{"url": request.META["HTTP_REFERER"], "reason": reason},
status=HttpResponseForbidden.status_code,
)