From d5c41b4a94af9766405297ae3c8917c154bfaf05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Fabr=C3=ADcio=20Costa?= Date: Wed, 18 Jun 2025 19:08:24 -0300 Subject: [PATCH] Create instance directory when config doesn't exist --- rifaserver/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rifaserver/app.py b/rifaserver/app.py index 8e0d5eb..2794fb6 100644 --- a/rifaserver/app.py +++ b/rifaserver/app.py @@ -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)