diff --git a/thermostat.py b/thermostat.py index 4a28e37..479a7a3 100644 --- a/thermostat.py +++ b/thermostat.py @@ -129,7 +129,8 @@ class Status_thermostat(Resource): return result api.add_namespace(ns_thermostat) -db.create_all() +with app.app_context(): + db.create_all() migrate = Migrate(app, db, compare_type=True)