1
0
Fork 0
mirror of https://github.com/shouptech/flask-tutorial.git synced 2026-02-03 07:29:42 +00:00

Get SECRET_KEY from environment

This commit is contained in:
Emma 2018-11-02 19:06:18 -06:00
parent fc55d01d03
commit e7e24e489f
2 changed files with 4 additions and 1 deletions

View file

@ -4,6 +4,9 @@ jobs:
docker:
- image: python:3
environment:
SECRET_KEY: DEV
steps:
- checkout
- run: pip install pytest coverage

View file

@ -7,8 +7,8 @@ def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
SECRET_KEY = os.environ.get("SECRET_KEY", default=None)
)
if test_config is None: