User Based Debug your Django App
I'm a huge fan of this Erich Holscher djangosnippet which is included in django-sugar. This middleware allows you to easily debug your django app whether you're an admin user or your machine's IP is listed in settings.py INTERNAL_IPS tuple. Here is is in its entirety below.
from django.views.debug import technical_500_response
import sys
from django.conf import settings
class UserBasedExceptionMiddleware(object):
def process_exception(self, request, exception):
if request.user.is_superuser or request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:
return technical_500_response(request, *sys.exc_info())

Twitter
RSS
Email
blog comments powered by Disqus