Schule als Staat Projekt Web, Dokumente, etc.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

24 строки
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}))