-
-
Save nervouna/cd58fb09c22826eaaff996793de72d85 to your computer and use it in GitHub Desktop.
How to generate a secret key with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to generate a secret key with Python | |
# via http://flask.pocoo.org/docs/quickstart/ | |
import os | |
import binascii | |
os.urandom(24) | |
# Out: b'\x83[\x14\xa4s\xde\xdd\xed\xed/\xd0&-\xc6N\xd5\xb7\xf8O\xd5(\xce\xca,' | |
# Or if you want a prettier one: | |
binascii.hexlify(os.urandom(24)) | |
# Out: b'5a77d33bc5e2fd877540d80a03cd75e74926c8e8ee9e0c2b' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment