Пример #1
0
def create_app():
    my_app = Flask(__name__)
    my_app.config.from_pyfile('conf.py')
    models.init_app(my_app)
    services.init_app(my_app)
    routes.init_app(my_app)

    return my_app
Пример #2
0
def create_app():
    app = Flask(__name__)
    CORS(app)
    app.config.from_object(config.Config)
    resources.init_app(app)
    models.init_app(app)
    services.init_app(app)
    return app
Пример #3
0
def init_app(app):
    with app.app_context():
        config.init_app(app)
        models.init_app(app)
        routes.init_app(app)
        services.init_app(app)

        # -- <testing user> -----------------------------------------------
        admin_user = services.user_service.getByUsername('admin')
        if admin_user is None:
            services.user_service.insert('admin', 'admin')
        # -- </testing user> ----------------------------------------------

    app.run(debug=True, port=3000)
Пример #4
0
def create_app():
    import models, routes, services, database

    app = Flask(__name__)
    app.config['SQLALCHEMY_TRACK_MODIFICARIONS'] = False
    app.config[
        'SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database/upforgoodDB.sqlite3'
    app.config['SECRET_KEY'] = 'super-secret'
    CORS(app)
    #cors = CORS(app, resources={r"/api/*": {"origins": "*"}})

    models.init_app(app)
    routes.init_app(app)
    services.init_app(app)
    database.init_app(app)

    if __name__ == "__main__":
        app.run(debug=True)

    return app
Пример #5
0
def create_app():
    app = Flask(__name__)
    models.init_app(app)
    routes.init_app(app)
    services.init_app(app)
    return app
Пример #6
0
import models
import services
import commands

from factory import create_app
from utilities.constant import config_env

app = create_app(__name__, config_env())

services.init_app(app, models.db)
commands.init_app(app)
Пример #7
0
import services
from factory import create_app
from models import db
from tasks.queue import queue
import actions
from utilities.constant import config_env

app = create_app(__name__, config_env())
queue.init_app(app)
services.init_app(app, db)
actions.init_app(app)
celery = queue.celery