def create_app(settings=settings): app = Flask(__name__) app.config.from_object(settings) app.jinja_env.add_extension(HamlPyExtension) app.jinja_env.hamlish_mode = 'indented' # initialize extensions and assets init_extensions(application=app) init_assets(application=app) # register blueprints app.register_blueprint(dummy.dummy) return app
def create_app(config_override=None): application = Flask(__name__) import config application.config.from_object(config) application.config.from_object(config_override) from models import db db.init_app(application) from blueprints.api import api api.init_app(application) import assets assets.init_assets(application) import blueprints for blueprint in blueprints.blueprints: application.register_blueprint(blueprint) import util util.init_utils(application) return application
# -*- coding: utf-8 -*- # # Copyright 2012 Frederic Rodrigo # # import bottle from bottle import route, view, template, error, redirect, request, hook from tools import utils, oauth, xmldict import beaker.middleware import assets app = bottle.default_app() assets.init_assets() @hook('before_request') def setup_request(): if request: request.session = request.environ['beaker.session'] for l in utils.allowed_languages: app.mount('/' + l, app) from bottle import SimpleTemplate SimpleTemplate.defaults["get_url"] = app.get_url import bottle_pgsql
# # Copyright 2012 Frederic Rodrigo # # import bottle from bottle import route, view, template, error, redirect, request, hook from tools import utils, oauth, xmldict import beaker.middleware import assets app = bottle.default_app() assets.init_assets() @hook('before_request') def setup_request(): if request: request.session = request.environ['beaker.session'] for l in utils.allowed_languages: app.mount('/' + l, app) from bottle import SimpleTemplate SimpleTemplate.defaults["get_url"] = app.get_url import bottle_pgsql app.install(bottle_pgsql.Plugin(utils.db_string)) import bottle_cors