Exemplo n.º 1
0
def create_web_app(**config):
    app = create_app(**config)

    app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')

    with app.app_context():

        from openspending.views import register_views
        register_views(app)

        from openspending.admin.routes import register_admin
        flaskadmin = admin.Admin(app, name='FIND Admin')
        #flaskadmin = Admin(app, url='/admin', name='admin2')
        register_admin(flaskadmin, db)

        from openspending.model import Dataset
        from openspending.model.country import Country
        whoosearch.whoosh_index(app, Dataset)
        whoosearch.whoosh_index(app, Country)

        from openspending.views.context import generate_csrf_token
        app.jinja_env.globals['csrf_token'] = generate_csrf_token

        from openspending.assets.assets import register_assets
        register_assets(assets)

    return app
Exemplo n.º 2
0
def create_web_app(**config):
    app = create_app(**config)

    app.jinja_env.add_extension("pyjade.ext.jinja.PyJadeExtension")

    with app.app_context():

        from openspending.views import register_views

        register_views(app)

        from openspending.admin.routes import register_admin

        flaskadmin = admin.Admin(app, name="FIND Admin")
        # flaskadmin = Admin(app, url='/admin', name='admin2')
        register_admin(flaskadmin, db)

        from openspending.model import Dataset
        from openspending.model.country import Country

        whoosearch.whoosh_index(app, Dataset)
        whoosearch.whoosh_index(app, Country)

        from openspending.views.context import generate_csrf_token

        app.jinja_env.globals["csrf_token"] = generate_csrf_token

        from openspending.assets.assets import register_assets

        register_assets(assets)

    return app
Exemplo n.º 3
0
def create_web_app(**config):
    app = create_app(**config)

    app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')

    with app.app_context():

        from openspending.views import register_views
        register_views(app)

        from openspending.admin.routes import register_admin
        flaskadmin = admin.Admin(app, name='FIND Admin')
        #flaskadmin = Admin(app, url='/admin', name='admin2')
        register_admin(flaskadmin, db)


    return app
Exemplo n.º 4
0
def create_web_app(**config):
    app = create_app(**config)

    app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')

    with app.app_context():

        from openspending.views import register_views
        register_views(app)

        from openspending.admin.routes import register_admin

        register_admin(app, db)

        from openspending.model import Dataset
        from openspending.model.country import Country
        from openspending.forum.forum.models import Category,Post,Topic,Forum
        whoosearch.whoosh_index(app,Dataset)
        whoosearch.whoosh_index(app, Country)
        whoosearch.whoosh_index(app, Category)
        whoosearch.whoosh_index(app, Post)
        whoosearch.whoosh_index(app, Topic)
        whoosearch.whoosh_index(app, Forum)

        from openspending.views.context import generate_csrf_token
        app.jinja_env.globals['csrf_token'] = generate_csrf_token 

        from openspending.assets.assets import register_assets
        register_assets(assets)  

        configure_template_filters(app)

        if os.environ.get("FLASK_DEBUGTOOLBAR", False):
            toolbar = DebugToolbarExtension(app)


    return app
Exemplo n.º 5
0
def create_web_app(**config):
    app = create_app(**config)

    app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')

    with app.app_context():

        from openspending.views import register_views
        register_views(app)

        from openspending.admin.routes import register_admin

        register_admin(app, db)

        from openspending.model import Dataset
        from openspending.model.country import Country
        from openspending.forum.forum.models import Category,Post,Topic,Forum
        whoosearch.whoosh_index(app,Dataset)
        whoosearch.whoosh_index(app, Country)
        whoosearch.whoosh_index(app, Category)
        whoosearch.whoosh_index(app, Post)
        whoosearch.whoosh_index(app, Topic)
        whoosearch.whoosh_index(app, Forum)

        from openspending.views.context import generate_csrf_token
        app.jinja_env.globals['csrf_token'] = generate_csrf_token 

        from openspending.assets.assets import register_assets
        register_assets(assets)  

        configure_template_filters(app)

        if os.environ.get("FLASK_DEBUGTOOLBAR", False):
            toolbar = DebugToolbarExtension(app)


    return app