[Answered ]-Static fiels doesn't load in django 1.11

1👍

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


def handler404(request):
    response = render_to_response('404.html', {},
                                  context_instance=RequestContext(request))
    response.status_code = 404
    return response


def handler500(request):
    response = render_to_response('500.html', {},
                                  context_instance=RequestContext(request))
    response.status_code = 500
    return response

Add in you views.py the following two views, and just set up the templates 404.html and 500.html with what you want to display.

No custom code needs to be added to urls.py

1👍

Just turn Debug to True in settings.py will solve this issue.

Leave a comment