I made a custom handler404 for a authenticated Django website to avoid information leakage.
def check_logged_in_404(request):
\"\"\" Custom 404. Show fr
You can use render
method:
from django.shortcuts import render
Returns a HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments.
Uses a RequestContext by default.
Example:
return render(request, '404.html', status=404)
And with keywords:
return render(request, '404.html', {'data': 'some data'}, status=404)