Super User Conditional Page Exception Reporting

1
2
3
4
5
6
7
from django.views.debug import technical_500_response
import sys

class UserBasedExceptionMiddleware(object):
    def process_exception(self, request, exception):
        if request.user.is_superuser:
            return technical_500_response(request, *sys.exc_info())

More like this

  1. Require login by url by zbyte64 4 years, 9 months ago
  2. RandomFileExtensionMiddleware by jezdez 4 years, 11 months ago
  3. Another Cookieless Session Middleware by lvscar 3 years, 11 months ago
  4. SSL Redirect Middleware by zbyte64 4 years, 10 months ago
  5. Simple Age Verification Middleware by eculver 3 years, 9 months ago

Comments

(Forgotten your password?)