Ejemplo n.º 1
0
def create_app():
    from mptracker import models
    from mptracker.common import common
    from mptracker.questions import questions
    from mptracker.pages import pages
    from mptracker.auth import auth
    from mptracker.admin import admin
    from mptracker.proposals import proposals
    from mptracker.votes import votes

    app = flask.Flask(__name__)
    app.config.from_pyfile('../settings.py', silent=True)
    app._logger = logger

    models.init_app(app)
    app.register_blueprint(common)
    app.register_blueprint(auth)
    app.register_blueprint(pages)
    app.register_blueprint(questions)
    app.register_blueprint(proposals)
    app.register_blueprint(votes)
    admin.init_app(app)

    if app.debug:
        from werkzeug.debug import DebuggedApplication
        app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True)

    if app.config.get('SENTRY_DSN'):
        from raven.contrib.flask import Sentry
        Sentry(app)

    return app
Ejemplo n.º 2
0
def create_app():
    app = flask.Flask(__name__)
    configure(app)
    models.init_app(app)
    app.register_blueprint(common)
    app.register_blueprint(auth)
    app.register_blueprint(pages)
    app.register_blueprint(questions)
    app.register_blueprint(proposals)
    app.register_blueprint(votes)
    admin.init_app(app)
    app._logger = logger
    if app.debug:
        from werkzeug.debug import DebuggedApplication
        app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True)
    return app
Ejemplo n.º 3
0
def create_website_app():
    from mptracker import models
    from mptracker.common import common
    from mptracker.website.pages import pages

    app = flask.Flask(__name__, static_folder='../static')
    app.config.from_pyfile('../../settings.py', silent=True)
    app._logger = logger
    models.init_app(app)
    app.register_blueprint(common)
    app.register_blueprint(pages)

    if app.config.get('SENTRY_DSN'):
        from raven.contrib.flask import Sentry
        Sentry(app)

    return app
Ejemplo n.º 4
0
def create_website_app():
    from mptracker import models
    from mptracker.common import common
    from mptracker.website.pages import pages

    app = flask.Flask(__name__, static_folder='../static')
    app.config.from_pyfile('../../settings.py', silent=True)
    app._logger = logger
    models.init_app(app)
    app.register_blueprint(common)
    app.register_blueprint(pages)

    if app.config.get('SENTRY_DSN'):
        from raven.contrib.flask import Sentry
        Sentry(app)

    return app