def app(): app = SkyLines(config_file=config.TESTING_CONF_PATH) _db.init_app(app) oauth.init_app(app) @app.route('/') @oauth.require_oauth() def index(): return 'success' return app
def app(): app = SkyLines(config_file=config.TESTING_CONF_PATH) _db.init_app(app) oauth.init_app(app) cors.init_app(app) @app.route('/secrets') @oauth.required() def secrets(): return jsonify({'secrets': [1, 1, 2, 3, 5, 8, 13]}) @app.route('/user') @oauth.optional() def user(): return jsonify({'user': request.user_id}) return app
def app(): app = SkyLines(config_file=config.TESTING_CONF_PATH) app.response_class = ApiResponse _db.init_app(app) oauth.init_app(app) cors.init_app(app) @app.route("/secrets") @oauth.required() def secrets(): return jsonify({"secrets": [1, 1, 2, 3, 5, 8, 13]}) @app.route("/user") @oauth.optional() def user(): return jsonify({"user": request.user_id}) return app
def add_sqlalchemy(self): """ Create and configure SQLAlchemy extension """ from skylines.database import db db.init_app(self)