diff --git a/app.py b/app.py index d6982de..8eccb79 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ from flask import Flask, jsonify -from flask_jwt_extended import JWTManager from flask_cors import CORS +from flask_jwt_extended import JWTManager +from flask_migrate import Migrate from jsonschema.exceptions import ValidationError from werkzeug.exceptions import BadRequest from flask_sqlalchemy import SQLAlchemy @@ -46,11 +47,9 @@ app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI #db = SQLAlchemy() db.init_app(app) -# Late beceuse of circular import -## +Migrate(app, db) - -app.logger.setLevel(logging.INFO) +app.logger.setLevel(logging.INFO) app.register_blueprint(api_v1) app.register_blueprint(web) diff --git a/areas/cliapp/cli.py b/areas/cliapp/cli.py index 81421c8..32d65e3 100644 --- a/areas/cliapp/cli.py +++ b/areas/cliapp/cli.py @@ -24,8 +24,6 @@ import ory_kratos_client # Flask from flask import Flask, abort, redirect, render_template, request from flask.cli import AppGroup -from flask_migrate import Migrate -from flask_sqlalchemy import SQLAlchemy from ory_kratos_client.api import v0alpha2_api as kratos_api from areas import cli diff --git a/database.py b/database.py index 5c1c832..cc45acb 100644 --- a/database.py +++ b/database.py @@ -1,7 +1,2 @@ - - from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() - - -