Incognos
Incognos
Jul 24, 2017 · 1 min read
os.environ['SECRET_KEY']

Bad mojo if the key is not set, your app will crash. You can handle this many ways, but a favorite is:

os.environ.get('SECRET_KEY')

or set a sane default:

os.environ.get('SECRET_KEY', 'this-is-my-sane-default-if-no-key-exists')
    Incognos

    Written by

    Incognos

    Just someone looking for the humor in it all. The only thing I really know, is that I don’t really know anything.