Handling Custom Error Pages(404, 500) In Django

def handler404(request):
return render(request, '404.html', status=404)
def handler500(request):
return render(request, '500.html', status=500)
handler404 = myapp.views.handler404
handler500 = myapp.views.handler500
ALLOWED_HOSTS = ['testsite.com', 'localhost']

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store