read secret key from json file

This commit is contained in:
Lynne Megido 2019-08-31 13:26:20 +10:00
parent bc0dcfb754
commit aea1cc7ccc
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
__pycache__
config.json

View File

@ -1,7 +1,10 @@
from flask import Flask, render_template, session
import json
cfg = json.load(open("config.json"))
app = Flask(__name__)
app.secret_key = "debug key"
app.secret_key = cfg['secret_key']
@app.route("/")
def hello():