21đ
Does your django settings.py file even look in the environment?
It does not, by default, care about anything youâve set in the environment (via âconfig:setâ). If youâre âcastingâ the environment to a boolean, make sure youâre casting it correctly. bool(âFalseâ) is still True.
Itâs simplest just to detect if the environment variable exists so you donât have to worry about type casting or specific formats of the configuration.
DEBUG = os.environ.get('DEBUG', False)
To disable debug, remove the variable from the environment instead of trying to type cast⊠it just seems much more reliable and fool proof. config:unset DEBUG
3đ
The problem is that the environment variable is not a boolean, rather a string.
So do place below line in settings.py
DEBUG = (os.environ.get('DEBUG_VALUE') == 'True')
- Can I get expiration time of specified key in django cache?
- IPython doesn't work in Django shell
- Django.db.utils.OperationalError: FATAL: role "django" does not exist
- Django m2m_changed signal is never called