Best practice to handle global 500 errors in Django?
okay, now I understand how Http404 works. So you have to define this Http500 exception somewhere, and catch it in middleware.
I have a django app running with MySQL and Redis as backend
I have a function called redis_helper() to do redis queries. 
But sometimes Redis crash and needs sometime to bootup, so I need to return a friendly HTTP 500 error message.
The problem is, django only defines Http404(Exception) class in django/http/__init__.py, not Http500(), so I have to manually add try ... except in every view function where redis_helper() was involved. It feel a bit ugly and repeating work.
Are there any convenient way to raise server 500 error not using return HttpResponseServerError() in view functions? If I have to write Http500 class myself which file is the best place to write it?
Regards and thank you!