I’m working on a fairly simple Pylons 0.9.7 application. How do I tell, in code, whether or not debugging is enabled? That is, I’m interested in the value of the debug setting under [app:main] in my INI file. More generally, how do I access the other values from there in my code?
Share
I’m not sure if this holds in Pylons, as I’ve never used that — but in “normal” command line Python, debug is enabled if optimizations are not enabled. The
-Oflag indicates to Python to turn on optimizations.Actually, there’s this snippet from Pylons documentation:
Looks like
config['debug']is what you want.