I spent several hours on this code and could not get to find out why I am getting server error (500) instead of 404.html in django program. Please see below codes and could someone help?
settings.py:
DEBUG = False
ALLOWED_HOSTS = ['*']
urls.py: (app is mysite)
handler404 = "mysite.views.error_404"
views.py:
def error_404(request, exception):
return render(request, '404.html')
404.html:
{% extends "base.html" %}
{% load static %}
{% block main %}
some html text here
{% endblock %}
Error message from log:

Try getting rid of all the extend commands from your 404 page and render a plain HTML page with no Django extends.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With