Create instance directory when config doesn't exist
This commit is contained in:
parent
b6a66e297f
commit
d5c41b4a94
|
|
@ -68,6 +68,7 @@ def create_app():
|
||||||
app.config['SECRET_KEY'] = secrets.token_hex()
|
app.config['SECRET_KEY'] = secrets.token_hex()
|
||||||
print(f"Using generated key {app.config['SECRET_KEY']}")
|
print(f"Using generated key {app.config['SECRET_KEY']}")
|
||||||
_config['SECRET_KEY'] = app.config['SECRET_KEY']
|
_config['SECRET_KEY'] = app.config['SECRET_KEY']
|
||||||
|
os.makedirs(app.instance_path, exist_ok=True)
|
||||||
with open(config_filename, 'w') as f:
|
with open(config_filename, 'w') as f:
|
||||||
json.dump(_config, f)
|
json.dump(_config, f)
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue