Exemplo n.º 1
0
def create_app():
    app = Flask(__name__)
    app.config.from_mapping(config)

    from core.cli import CLI
    from core.database import db

    from apps.user import UserModule
    from apps.post import PostModule
    from apps.comment import CommentModule
    from apps.category import CategoryModule
    from apps.file import FileModule

    cli = CLI()
    cors = CORS()
    migrate = Migrate()

    user = UserModule()
    post = PostModule()
    comment = CommentModule()
    category = CategoryModule()
    file = FileModule()

    cors.init_app(app)
    cli.init_app(app)
    db.init_app(app)
    migrate.init_app(app, db)

    user.init_app(app)
    post.init_app(app)
    comment.init_app(app)
    category.init_app(app)
    file.init_app(app)

    return app
Exemplo n.º 2
0
def create_app(test_config=None):
    app = Flask(__name__, static_folder=config['STATIC_FOLDER'])
    if test_config is not None:
        app.config.from_mapping(test_config)
    app.config.from_mapping(config)

    from core.cli import CLI
    from core.database import db

    from apps.user import UserModule
    from apps.food import FoodModule
    from apps.store import StoreModule
    from apps.order import OrderModule
    from apps.driver import DriverModule
    # from apps.category_access import CategoryAccessModule

    cli = CLI()
    cors = CORS()
    migrate = Migrate()
    jwt = JWTManager(app)

    user = UserModule()
    food = FoodModule()
    store = StoreModule()
    order = OrderModule()
    driver = DriverModule()
    # category_access = CategoryAccessModule()

    jwt.init_app(app)
    cli.init_app(app)
    cors.init_app(app)
    db.init_app(app)
    migrate.init_app(app, db)

    user.init_app(app)
    food.init_app(app)
    store.init_app(app)
    order.init_app(app)
    driver.init_app(app)
    # category_access.init_app(app)

    return app
Exemplo n.º 3
0
def create_app(test_config=None):
    app = Flask(__name__)
    if test_config is not None:
        app.config.from_mapping(test_config)
    app.config.from_mapping(config)

    from core.cli import CLI
    from core.database import db

    from apps.user import UserModule
    from apps.file import FileModule
    from apps.job import JobModule
    from apps.category_access import CategoryAccessModule

    cli = CLI()
    cors = CORS()
    migrate = Migrate()
    jwt = JWTManager(app)

    user = UserModule()
    file = FileModule()
    job = JobModule()
    category_access = CategoryAccessModule()

    jwt.init_app(app)
    cli.init_app(app)
    cors.init_app(app)
    db.init_app(app)
    migrate.init_app(app, db)

    user.init_app(app)
    file.init_app(app)
    job.init_app(app)
    category_access.init_app(app)

    return app