Пример #1
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))
Пример #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=['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)
Пример #3
0
app.geoip = None
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))
Пример #4
0
        '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_root',
    view_func=app.send_static_file,
    subdomain=None,
)
app.add_url_rule(
    '/static/<path:filename>',
    endpoint='static_subdomain',
    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'),
)