hi,
in my django project I am using python-decouple to read variables from a .env file while I am developing locally. there I use DEBUG=True
.
nore: the file .env is not commited to github.
in CircleCI I am using environment variables. there I set DEBUG=true
.
in my settings.py file I do the following:
...
DEBUG = config('DEBUG', default=False, cast=bool)
...
if not DEBUG:
# this is done only on heroku (where I set the env var to DEBUG=0)
"send errors to sentry.io"
...
the result is that I am logging errors in sentry.io while running unit tests on CircleCI. I don’t want to do that…
my impression is that CircleCI interprets DEBUG=true
as a string…
note: I also tried DEBUG=True
and DEBUG=1
, all with the same result.
how do I have to declare environment variable DEBUG to be a boolean?