Created
February 25, 2019 14:21
-
-
Save bergpb/69233350254cc7c650c3812512ec044a to your computer and use it in GitHub Desktop.
Create a SECRET_KEY for Flask apps.
This file contains hidden or 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
| #using os, python2/3 | |
| import os | |
| os.urandom(12) | |
| #using uuid, python2/3 | |
| import uuid | |
| uuid.uuid4().hex | |
| #using secrets, python>=3.6 | |
| import secrets | |
| secrets.token_urlsafe(16) | |
| #using os in python3 | |
| import os | |
| os.urandom(12).hex() | |
| #tnks for | |
| #https://stackoverflow.com/questions/34902378/where-do-i-get-a-secret-key-for-flask |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment