text: from flasgger import Swagger
  from flask import Flask
  from flask_cors import CORS
  from flask_migrate import Migrate
  from flask_sqlalchemy import SQLAlchemy
  
  
  cors = CORS()
  db = SQLAlchemy()
  migrate = Migrate()
  swagger = Swagger()
  
  
  def create_app():
  
      app = Flask(__name__, instance_relative_config=False, static_url_path='')
  
      app.config.from_object('pysomatic.config.Config')
  
      cors.init_app(app, supports_credentials=True)
      db.init_app(app)
      migrate.init_app(app)
      swagger.init_app(app)
  
      with app.app_context():
  
          # MUST import libraries here to avoid circular dependencies
          from pysomatic.routes import (
              views,
              models
          )
  
          app.register_blueprint(views.views)
          app.register_blueprint(models.models)
  
      return app
  