I am trying to get custom error pages (404 & 500) to work in my Django application.
So far I have the following:
urls.py
handler404 = views.error_404
handle500 = views.error_500
views.py
def error_500(request, exception):
return render(request, '500.html', status=500)
def error_404(request, exception):
return render(request, '404.html', status=404)
DEBUG is set to FALSE.
However when I try access an error page I get the following error:
"A server error occurred. Please contact the administrator."
Which (obviously) is not my error template.
Any help appreciated!