initiate Api within create_app function to prevent apispec.exceptions.DuplicateComponentNameError

This commit is contained in:
Finn Christiansen 2021-01-27 19:50:41 +01:00
parent aa882297c3
commit 0df6f5956f

View file

@ -6,7 +6,6 @@ from flask_migrate import Migrate
#from flask_jwt_extended import JWTManager
api = Api()
db = SQLAlchemy()
ma = Marshmallow()
#jwt = JWTManager()
@ -23,6 +22,7 @@ def create_app(cfg='default'):
from . import resources
api = Api()
api.init_app(app)
db.init_app(app)
ma.init_app(app)