secret key update
now requires SECRET_KEY to be defined in app config file
This commit is contained in:
@@ -6,16 +6,12 @@ from flask import Flask
|
|||||||
def create_app(test_config=None):
|
def create_app(test_config=None):
|
||||||
# create and configure the app
|
# create and configure the app
|
||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
app.config.from_mapping(
|
app.config.from_pyfile('config.py')
|
||||||
SECRET_KEY='dev',
|
app.config.from_mapping(DATABASE=os.path.join(app.instance_path, 'database.sqlite'),)
|
||||||
DATABASE=os.path.join(app.instance_path, 'database.sqlite'),
|
|
||||||
)
|
|
||||||
|
|
||||||
# ensure the instance folder exists
|
# ensure the instance folder exists
|
||||||
os.makedirs(app.instance_path, exist_ok=True)
|
os.makedirs(app.instance_path, exist_ok=True)
|
||||||
|
|
||||||
app.config.from_pyfile('config.py')
|
|
||||||
|
|
||||||
from . import db
|
from . import db
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user