Hmm, I didnt know that, I'm still fairly new to python and django.  So
if I understand this right DEBUG is basically static once the server
starts and will only change with a restart of the server (whatever
environment that happens to be in).  Thanks for the help!

-Josh

On Nov 15, 4:32 am, Tom Evans <[email protected]> wrote:
> On Fri, Nov 12, 2010 at 5:41 PM, Josh <[email protected]> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to