On Fri, Nov 12, 2010 at 5:41 PM, Josh <josh...@gmail.com> wrote:
> I didnt look at the blog post but you could try something like this in
> your settings:
>
> def debug_for_superuser(request):
>    if request.user.is_superuser:
>        return True
>    else:
>        return False
>
> DEBUG = debug_for_superuser
>
> I haven't actually tried this but I use something like that to only
> show the debug toolbar for superusers.  You could also substitute
> is_superuser for something like is_staff, or do a lot more using the
> extensive django user authentication.  Check out this link:
> http://docs.djangoproject.com/en/dev/topics/auth/
>

settings.DEBUG is not used as a callable, so you cannot do this (just
think: 'where does the request come from' or: 'how would this work
outside of the request-response cycle'). The blog post referenced by
an earlier response is the correct way to attempt this.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to