handler404 returning Server Error (500) instead of 404.html - Django/Python

I find solve of this problem here.

Long story short: use template_name=“path/to/your/403_template.html” in args of you function
This is my func:

def custom_404_view(request, exception=None, template_name="status_code/404.html"):

    content = loader.render_to_string('status_code/404.html', {}, request)

return HttpResponseNotFound(content)