Ejemplo n.º 1
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))
Ejemplo n.º 2
0
def init_for(env):
    coaster.app.init_app(app, env)
    baseframe.init_app(app, requires=['baseframe', 'commentease', 'hasnew'])
    commentease.init_app(app)
    lastuser.init_app(app)
    lastuser.init_usermanager(UserManager(db, models.User))
Ejemplo n.º 3
0
assets['boxoffice.css'][version] = 'css/app.css'
assets['boxoffice.js'][version] = 'js/scripts.js'

from . import extapi, views  # NOQA
from .models import db, User, Item, Price, DiscountPolicy, DiscountCoupon, ItemCollection, Organization, Category, Invoice  # noqa
from .siteadmin import OrganizationModelView, DiscountCouponModelView, InvoiceModelView  # noqa

# Configure the app
coaster.app.init_app(app)
db.init_app(app)
db.app = app
migrate = Migrate(app, db)
rq.init_app(app)

lastuser.init_app(app)
lastuser.init_usermanager(UserManager(db, User))
app.config['tz'] = timezone(app.config['TIMEZONE'])
baseframe.init_app(app,
                   requires=['boxoffice'],
                   ext_requires=[
                       'baseframe-bs3', 'fontawesome>=4.0.0',
                       'baseframe-footable', 'jquery.tinymce>=4.0.0'
                   ])

mail.init_app(app)
wtforms_json.init()

# This is a temporary solution for an admin interface, only
# to be used until the native admin interface is ready.
try:
    admin = Admin(app,
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-

# The imports in this file are order-sensitive

from pytz import timezone
from flask import Flask
from flask_lastuser import Lastuser
from flask_lastuser.sqlalchemy import UserManager
from baseframe import baseframe, assets, Version
from flask_migrate import Migrate
import coaster.app
from ._version import __version__

version = Version(__version__)
app = Flask(__name__, instance_relative_config=True)
lastuser = Lastuser()

from . import models, views
from .models import db

assets['kharcha.css'][version] = 'css/app.css'

# Configure the app
coaster.app.init_app(app)
migrate = Migrate(app, models.db)
baseframe.init_app(app, requires=['baseframe', 'jquery.expander', 'kharcha'])
lastuser.init_app(app)
lastuser.init_usermanager(UserManager(models.db, models.User, models.Team))
app.config['tz'] = timezone(app.config['TIMEZONE'])