DEV Community

Discussion on: Django Cheat Sheet: Keep Credentials Secure with Environment Variables

guettli profile image
Thomas Güttler

Don't ask my why the author did not accept my PR:

Converting types

The library reads and provides strings. If you need for example a boolean, it is up to you to convert the value.


from distutils.util import strtobool
DEBUG = bool(strtobool(os.getenv('DEBUG', 'True')))
Enter fullscreen mode Exit fullscreen mode