0

Question as in title. How to set custom page for an error in django. I tried using just in templates new file like '403.html' but it did not work. I tried also this:

def handler404(request, exception, template_name="404.html"):
    response = render_to_response(template_name)
    response.status_code = 404
    return response

but I can not import render_to_response

Kay
  • 591
  • 1
  • 7
  • 27

1 Answers1

0

There are two different versions of a 403 error, one is specifically for CSRF issues.

You may need to use a template named 403_csrf.html in addition to 403.html

More information can be found at the following links:

Jimmy Pells
  • 674
  • 1
  • 5
  • 12