Create instance directory when config doesn't exist

This commit is contained in:
Clóvis Fabrício Costa 2025-06-18 19:08:24 -03:00
parent b6a66e297f
commit d5c41b4a94
1 changed files with 1 additions and 0 deletions

View File

@ -68,6 +68,7 @@ def create_app():
app.config['SECRET_KEY'] = secrets.token_hex()
print(f"Using generated 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:
json.dump(_config, f)
db.init_app(app)