Ejemplo n.º 1
0
def init_for(env):
    coaster.app.init_app(app, env)
    db.init_app(app)
    db.app = app

    app.geoip = None
    if 'GEOIP_PATH' in app.config:
        geoip_database_path = os.path.join(app.config['GEOIP_PATH'], 'GeoLite2-City.mmdb')
        if not os.path.exists(geoip_database_path):
            app.logger.warn("GeoIP database missing at " + geoip_database_path)
        else:
            app.geoip = geoip2.database.Reader(geoip_database_path)

    RQ(app)

    baseframe.init_app(app, requires=['hasjob'],
        ext_requires=['baseframe-bs3',
            ('jquery.autosize', 'jquery.sparkline', 'jquery.liblink', 'jquery.wnumb', 'jquery.nouislider'),
            'firasans>=4.2.0', 'baseframe-firasans', 'fontawesome>=4.3.0', 'bootstrap-multiselect', 'nprogress', 'ractive', 'jquery.appear', 'hammer'],
        enable_csrf=True)
    # TinyMCE has to be loaded by itself, unminified, or it won't be able to find its assets
    app.assets.register('js_tinymce', assets.require('!jquery.js', 'tinymce.js>=4.0.0', 'jquery.tinymce.js>=4.0.0'))
    app.assets.register('css_editor', Bundle('css/editor.css',
        filters=['cssrewrite', 'cssmin'], output='css/editor.packed.css'))

    from hasjob.uploads import configure as uploads_configure
    uploads_configure()
    mail.init_app(app)
    redis_store.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 2
0
def init_for(env):
    coaster.app.init_app(app, env)
    RQ(app)
    if app.config.get('SERVER_NAME'):
        subdomain = app.config.get('STATIC_SUBDOMAIN', 'static')
    else:
        subdomain = None
    app.add_url_rule('/static/<path:filename>', endpoint='static',
        view_func=app.send_static_file, subdomain=subdomain)
    baseframe.init_app(app, requires=['hasjob'],
        ext_requires=[('jquery.textarea-expander', 'jquery.tinymce', 'jquery.form', 'jquery.cookie',
        'select2', 'jquery.sparkline','jquery.nouislider'), 'firasans', 'baseframe-networkbar'])
    app.assets.register('js_tinymce', assets.require('tiny_mce.js>=3.5.0,<4.0.0'))
    if subdomain:
        # The /_baseframe path has to be under the current domain because TinyMCE
        # doesn't like loading from a subdomain, but we also need access to /_baseframe
        # in the static subdomain for other assets (potentially obsoleted by ext_requires)
        app.add_url_rule(baseframe.static_url_path + '/<path:filename>',
            view_func=baseframe.send_static_file,
            endpoint='baseframe_static', subdomain=subdomain)

    from hasjob.uploads import configure as uploads_configure
    from hasjob.search import configure as search_configure
    uploads_configure()
    search_configure()
    mail.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 3
0
def init_for(env):
    coaster.app.init_app(app, env)
    RQ(app)

    baseframe.init_app(app,
                       requires=['hasjob'],
                       ext_requires=[
                           'baseframe-bs3',
                           ('jquery.textarea-expander', 'jquery.cookie',
                            'jquery.sparkline', 'jquery.nouislider'),
                           ('firasans', 'baseframe-firasans'),
                           'fontawesome>=4.0.0'
                       ])
    # TinyMCE has to be loaded by itself, unminified, or it won't be able to find its assets
    app.assets.register(
        'js_tinymce',
        assets.require('!jquery.js', 'tinymce.js>=4.0.0',
                       'jquery.tinymce.js>=4.0.0'))
    app.assets.register(
        'css_editor',
        Bundle('css/editor.css',
               filters=['cssrewrite', 'cssmin'],
               output='css/editor.packed.css'))

    from hasjob.uploads import configure as uploads_configure
    from hasjob.search import configure as search_configure
    uploads_configure()
    search_configure()
    mail.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 4
0
def init_for(env):
    coaster.app.init_app(app, env)
    from hasjob.search import configure as search_configure
    from hasjob.uploads import configure as uploads_configure
    search_configure()
    uploads_configure()
    mail.init_app(app)
    lastuser.init_app(app)
    assets.register('js_all', js)
    assets.register('css_all', css)
Ejemplo n.º 5
0
def init_for(env):
    coaster.app.init_app(app, env)
    from hasjob.search import configure as search_configure
    from hasjob.uploads import configure as uploads_configure
    search_configure()
    uploads_configure()
    mail.init_app(app)
    lastuser.init_app(app)
    assets.register('js_all', js)
    assets.register('css_all', css)
Ejemplo n.º 6
0
def init_for(env):
    coaster.app.init_app(app, env)
    baseframe.init_app(app, requires=['jquery.textarea-expander', 
        'jquery.tinymce', 'jquery.form', 'jquery.cookie', 'select2', 'jquery.sparkline', 'baseframe-networkbar', 'hasjob'
        ])
    app.assets.register('js_tinymce', assets.require('tiny_mce.js>=3.5.0,<4.0.0'))
    from hasjob.search import configure as search_configure
    from hasjob.uploads import configure as uploads_configure
    search_configure()
    uploads_configure()
    mail.init_app(app)
    lastuser.init_app(app)
Ejemplo n.º 7
0
def init_for(env):
    coaster.app.init_app(app, env)
    db.init_app(app)
    db.app = app

    app.geoip = None
    if 'GEOIP_PATH' in app.config:
        geoip_database_path = os.path.join(app.config['GEOIP_PATH'],
                                           'GeoLite2-City.mmdb')
        if not os.path.exists(geoip_database_path):
            app.logger.warn("GeoIP database missing at " + geoip_database_path)
        else:
            app.geoip = geoip2.database.Reader(geoip_database_path)

    RQ(app)

    baseframe.init_app(app,
                       requires=['hasjob'],
                       ext_requires=[
                           'baseframe-bs3',
                           ('jquery.autosize', 'jquery.sparkline',
                            'jquery.liblink', 'jquery.wnumb',
                            'jquery.nouislider'), 'baseframe-firasans',
                           'fontawesome>=4.3.0', 'bootstrap-multiselect',
                           'nprogress', 'ractive', 'jquery.appear', 'hammer'
                       ],
                       enable_csrf=True)
    # TinyMCE has to be loaded by itself, unminified, or it won't be able to find its assets
    app.assets.register(
        'js_tinymce',
        assets.require('!jquery.js', 'tinymce.js>=4.0.0',
                       'jquery.tinymce.js>=4.0.0'))
    app.assets.register(
        'css_editor',
        Bundle('css/editor.css',
               filters=['cssrewrite', 'cssmin'],
               output='css/editor.packed.css'))

    from hasjob.uploads import configure as uploads_configure
    uploads_configure()
    mail.init_app(app)
    redis_store.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 8
0
def init_for(env):
    coaster.app.init_app(app, env)
    RQ(app)
    if app.config.get('SERVER_NAME'):
        subdomain = app.config.get('STATIC_SUBDOMAIN', 'static')
    else:
        subdomain = None
    app.add_url_rule('/static/<path:filename>', endpoint='static',
        view_func=app.send_static_file, subdomain=subdomain)
    baseframe.init_app(app, requires=['jquery.textarea-expander',
        'jquery.tinymce', 'jquery.form', 'jquery.cookie', 'select2', 'jquery.sparkline', 'baseframe-networkbar', 'hasjob'
        ])
    app.assets.register('js_tinymce', assets.require('tiny_mce.js>=3.5.0,<4.0.0'))
    from hasjob.uploads import configure as uploads_configure
    from hasjob.search import configure as search_configure
    uploads_configure()
    search_configure()
    mail.init_app(app)
    lastuser.init_app(app)
Ejemplo n.º 9
0
def init_for(env):
    coaster.app.init_app(app, env)
    RQ(app)

    baseframe.init_app(app, requires=['hasjob'],
        ext_requires=['baseframe-bs3',
            ('jquery.textarea-expander', 'jquery.cookie', 'jquery.sparkline','jquery.nouislider', 'jquery.tinymce>=4.0.0'),
            ('firasans', 'baseframe-firasans'),
            'fontawesome>=4.0.0'])
    app.assets.register('js_tinymce', assets.require('tinymce.js>=4.0.0'))
    app.assets.register('css_editor', Bundle('css/editor.css',
        filters=['cssrewrite', 'cssmin'], output='css/editor.packed.css'))

    from hasjob.uploads import configure as uploads_configure
    from hasjob.search import configure as search_configure
    uploads_configure()
    search_configure()
    mail.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 10
0
if 'GEOIP_PATH' in app.config:
    if not os.path.exists(app.config['GEOIP_PATH']):
        app.logger.warn("GeoIP database missing at " + app.config['GEOIP_PATH'])
    else:
        app.geoip = geoip2.database.Reader(app.config['GEOIP_PATH'])

RQ(app)

baseframe.init_app(app, requires=['baseframe-bs3', 'jquery.autosize', 'jquery.liblink',
    'jquery.wnumb', 'jquery.nouislider', 'baseframe-firasans', 'fontawesome>=4.3.0',
    'bootstrap-multiselect', 'nprogress', 'ractive', 'jquery.appear', 'hammer'])

# FIXME: Hack for external build system generating relative /static URLs.
# Fix this by generating absolute URLs to the static subdomain during build.
app.add_url_rule('/static/<path:filename>', endpoint='static',
    view_func=app.send_static_file, subdomain=None)
app.add_url_rule('/static/<path:filename>', endpoint='static',
    view_func=app.send_static_file, subdomain='<subdomain>')

# TinyMCE has to be loaded by itself, unminified, or it won't be able to find its assets
app.assets.register('js_tinymce', assets.require('!jquery.js', 'tinymce.js>=4.0.0', 'jquery.tinymce.js>=4.0.0'))
app.assets.register('css_editor', Bundle('css/editor.css',
    filters=['cssrewrite', 'cssmin'], output='css/editor.packed.css'))

from hasjob.uploads import configure as uploads_configure
uploads_configure()
mail.init_app(app)
redis_store.init_app(app)
lastuser.init_app(app)
lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 11
0
    else:
        app.geoip = geoip2.database.Reader(app.config['GEOIP_PATH'])

RQ(app)

baseframe.init_app(app,
                   requires=[
                       'baseframe-bs3', 'jquery.autosize', 'jquery.liblink',
                       'jquery.wnumb', 'jquery.nouislider',
                       'baseframe-firasans', 'fontawesome>=4.3.0',
                       'bootstrap-multiselect', 'nprogress', 'ractive',
                       'jquery.appear', 'hammer'
                   ])
# TinyMCE has to be loaded by itself, unminified, or it won't be able to find its assets
app.assets.register(
    'js_tinymce',
    assets.require('!jquery.js', 'tinymce.js>=4.0.0',
                   'jquery.tinymce.js>=4.0.0'))
app.assets.register(
    'css_editor',
    Bundle('css/editor.css',
           filters=['cssrewrite', 'cssmin'],
           output='css/editor.packed.css'))

from hasjob.uploads import configure as uploads_configure
uploads_configure()
mail.init_app(app)
redis_store.init_app(app)
lastuser.init_app(app)
lastuser.init_usermanager(UserManager(db, models.User))