Filter by Logged in User, Not IP Address #276

Miserlou opened this Issue Apr 9, 2012 · 6 comments


None yet

4 participants

Miserlou commented Apr 9, 2012

Feature request!

As far as I can see in the docs, the only way to filter who sees the toolbar right now is by IP Address.

Would it be possible to make add an INTERNAL_USERS settings, so that I could but in ('admin',) and have the debug toolbar only visible to the 'admin' user.

Would anybody be interested in this feature?

gw0 commented May 29, 2012

Hm, Debug Toolbar is intended to be used for debugging purposes during the developing phase. Why would someone want to make a development version of a site (running in debug mode) publicly accessible and limiting a toolbar only with the logged in Django user?

Imho it would make more sense protecting a development version of a site with a HTTP user/password (enforced by the web server, eg. .htpasswd etc..).

Miserlou commented Jun 7, 2012

Yeah, but production != development. Over time, they diverge. You try to stop it as much as you can, but idiosyncrasies always pop up over time, especially if you have a complicated database setup, proxies, balancers, etc, and when something goes wrong somewhere in that stack, I want DBT to be able to help. This feature would let me use DBT to debug a production-only problem without having to take the whole site down.

dcramer commented Jun 7, 2012

You can do this easily with the callback method, it's how we use it on staging

Miserlou commented Jun 7, 2012

"The callback method" ?

gw0 commented Jun 7, 2012

From the README.rst:

def custom_show_toolbar(request):
    return True # Always show toolbar, for example purposes only.

     'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
Miserlou commented Jun 8, 2012

Ah, wonderful. Thank you.

@aaugustin aaugustin closed this Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment