New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide error page views that add the guid to the HTML output #84
Comments
You should read about handler500. You can very simply add a callable like this: def handler500(request):
return TemplateResponse(request, '500.html', {'correlation_id': correlation_id.get()}, status=500) where the 500.html contains the HTML you wish to render 👍 Please feel free to report back with a solution when you're done. Could be cool to add a generalised example to the docs 🙏 |
Here's what worked for me New config/error_views.py:
In config/urls.py add:
Would you be amenable to including the "default with guid" error handlers to the package? |
I'll leave that up to @JonasKs to decide, but I think adding template code to the library is a little out-of-scope. Think the styling etc. should be up to the user to define. Think it's a nice thing to describe how to set up in the docs though 👏 |
Agree with @sondrelg 😊 Documentation PR very welcome, but I'd prefer not to maintain templates - styling is so different between everyone. |
I'll close this for now. If anyone else runs into similar issues, we now at least have your example to reference @andrew-cybsafe 👏 |
I would like an easy way to override the Django error page views so that the request guid is included as part of the HTML. This is useful so that customers can easily send the guid to a support team to get faster help.
The text was updated successfully, but these errors were encountered: