Making django-debug-toolbar display only for 'staff' users.
in settings.py (or local settings):
def show_toolbar_for_admin(request):
if request.user.is_authenticated():
return request.user.is_staff
else:
return False
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar_for_admin
}
Written by Javier Olaechea
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#N
Authors
Related Tags
#n
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#