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
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
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)
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
def create_app(): app = Flask(__name__) models.init_app(app) routes.init_app(app) services.init_app(app) return app
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)
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