Settings for debug/profile and use them in console plugin.

This commit is contained in:
Romain Dorgueil
2017-05-19 18:35:39 +02:00
parent e747bc1da8
commit e22f1bfb59
2 changed files with 26 additions and 9 deletions

16
bonobo/settings.py Normal file
View File

@ -0,0 +1,16 @@
import os
def to_bool(s):
if len(s):
if s.lower() in ('f', 'false', 'n', 'no', '0'):
return False
return True
return False
# Debug mode.
DEBUG = to_bool(os.environ.get('BONOBO_DEBUG', 'f'))
# Profile mode.
PROFILE = to_bool(os.environ.get('BONOBO_PROFILE', 'f'))