0

I want to show one special page for all error responses in Django. as following this issue Django, creating a custom 500/404 error page I add these items to my project files. but nothing changed!

setting.py

DEBUG = False
ALLOWED_HOSTS = ['localhost']

urls.py

handler500 = 'app.views.handler500'

views.py

from django.shortcuts import render_to_response
from django.template import RequestContext

def handler500(request, *args, **argv):
    response = render_to_response('app/500.html', {},
                                  context_instance=RequestContext(request))
    response.status_code = 500
    return response
Saeed Ramezani
  • 462
  • 6
  • 20

0 Answers0