sooo with DEBUG = False in your settings.py, it’ll show templates/500.html if there’s an error etc.
with DEBUG = True, django’s development error page thing will show and give you (a developer) I useful error message and debugging info
Q. In a production environment where I have DEBUG = False, is there a way to show the “development error page” for error’s which occur in the Django /admin site only?
e.g. it’s not neccessary to show a nice looking error page to an admin user, and I could more quickly fix a problem since an admin could just copy and paste and email the error to me, instead of me having to SSH into multiple application server things and inspect the log
Django’s DEBUG setting does other things (like log every SQL query) which will quickly consume your server memory, but sure why not handle exceptions however you like?
Django’s pretty-exception has a lot of code which sanitizes and introspects in
django.views.debugbut it should be straight forward to spit out a simple exception.Just create a middleware that uses the
process_exceptionhook.https://docs.djangoproject.com/en/dev/topics/http/middleware/?from=olddocs#process_exception
You’re free to return as much debug information as you’d like.