Schule als Staat Projekt Web, Dokumente, etc.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

24 řádky
880B

  1. from django.template.loader import render_to_string
  2. from django.http import (HttpResponseServerError, HttpResponseNotFound,
  3. HttpResponseForbidden, HttpResponseBadRequest)
  4. def error_404(request):
  5. return HttpResponseNotFound(render_to_string('404.html',
  6. context={'url': request.path}))
  7. def error_500(request):
  8. return HttpResponseServerError(render_to_string('500.html',
  9. context={'url': request.path}))
  10. def error_403(request):
  11. return HttpResponseForbidden(render_to_string('500.html',
  12. context={'url': request.path}))
  13. def error_400(request):
  14. return HttpResponseBadRequest(render_to_string('500.html',
  15. context={'url': request.path}))