hi all,

This is a silly newbie question, so please bear with me :D

Example:
...
def DoSomethingAwful(request):
  if __debug__:
    DoDebugStuff()
  ProcessRequest()
...

In the example above, I want django to call DoDebugStuff() *ONLY* if I'm
running my app on my development environment. So, my question is: Is the
__debug__ Python flag implicitly toggled depending on the value of the DEBUG
setting found in settings.py?

I'm asking this because I want part of my code to be executed only during
development and not in production. So, I was thinking of wrapping them
inside __debug__. (Basically, I was thinking of something like C macros
where you can toggle debugging)

If there is/are other ways to do this please let me know... I'd be happy to
try them out.

Thanks!

-- 
There are seven words in this sentence.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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