By default, Django doesn't run any context processors for server errors, to make the error path as simple as possible. However, this has the downside that our template does not load correctly. To fix this, I added a custom 500 error handler, which will run the context processor. Fixes: #2736
8 lines
215 B
Python
8 lines
215 B
Python
"""custom 500 handler to enable context processors"""
|
|
from django.template.response import TemplateResponse
|
|
|
|
|
|
def server_error(request):
|
|
"""server error page"""
|
|
|
|
return TemplateResponse(request, "500.html")
|