Why is it that when disabling
DEBUG in Django , static files, such as CSS , images, or JS are no longer recognized? I disable it to bring up custom error pages, but disabling
DEBUG all styles are removed. I would appreciate it very much, if you would tell me what I am missing, or what I am doing wrong.
DEBUG = False TEMPLATE_DEBUG = True ALLOWED_HOSTS = ["localhost"]
def handler404(request): return render(request,'error/404.html')
When you disable
DEBUG , Django will stop handling static files. In that case your production server should do it.
In order to display your custom error page, you must create a template called
404.html and place it at the root of your template directory.
Here you find more detailed information: