Example #1
0
def createApp(configfile=None):
    # We are using the "Application Factory"-pattern here, which is described
    # in detail inside the Flask docs:
    # http://flask.pocoo.org/docs/patternslo/appfactories/

    app = Flask(__name__)

    # Install our Bootstrap extensioappappn
    Bootstrap(app)

    # Our application uses blueprints as well; these go well with the
    # application factory. We already imported the blueprint, now we just need
    # to register it:
    app.register_blueprint(frontend)

    app.config.from_object('config')

    # Because we're security-conscious developers, we also hard-code disabling
    # the CDN support (this might become a default in later versions):
    app.config['BOOTSTRAP_SERVE_LOCAL'] = True

    setApp(app)
    initModuleRegisters()

    # We initialize the navigation as well
    nav.init_app(app)
    return app
Example #2
0
def create_app():
    a = Flask(__name__)
    a.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'

    Bootstrap(a)
    nav.init_app(a)
    return a
Example #3
0
def create_app(configfile=None):
    # We are using the "Application Factory"-pattern here, which is described
    # in detail inside the Flask docs:
    # http://flask.pocoo.org/docs/patterns/appfactories/

    app = Flask(__name__)

    # We use Flask-Appconfig here, but this is not a requirement
    AppConfig(app)

    # Install our Bootstrap extension
    Bootstrap(app)

    # Our application uses blueprints as well; these go well with the
    # application factory. We already imported the blueprint, now we just need
    # to register it:
    app.register_blueprint(frontend)

    # Because we're security-conscious developers, we also hard-code disabling
    # the CDN support (this might become a default in later versions):
    app.config['BOOTSTRAP_SERVE_LOCAL'] = True

    # We initialize the navigation as well
    nav.init_app(app)

    return app
Example #4
0
def create_app(configfile=None):
    #app = Flask(__name__)
    AppConfig(app)
    Bootstrap(app)
    app.register_blueprint(frontend)
    app.config['BOOTSTRAP_SERVE_LOCAL'] = True
    nav.init_app(app)
    return app
Example #5
0
def create_app(configfile=None):
    AppConfig(app)
    Bootstrap(app)
    app.config['UPLOADED_AUDIO_DEST'] = 'static/uploads'
    app.config['UPLOADS_DEFAULT_DEST'] = 'static/uploads'
    app.config['UPLOADED_AUDIO_URL'] = 'http://localhost:5000/static/uploads/'
    app.config['UPLOADS_DEFAULT_URL'] = 'http://localhost:5000/static/uploads/'
    app.config['TUNING_SYSTEM'] = 'real'
    configure_uploads(app, wavs)
    app.register_blueprint(frontend)
    app.register_blueprint(backend)
    nav.init_app(app)
    return app
Example #6
0
File: app.py Project: jleaniz/bdsa
        return render_template('index.html')
    else:
        flash('Spark: Unable to cancel jobs', 'error')
        return render_template('index.html')


if __name__ == "__main__":
    # Init spark context and load libraries
    app = Flask(__name__)
    app.config['SESSION_TYPE'] = 'filesystem'
    #app.config['BOOTSTRAP_CDN_FORCE_SSL'] = False
    app.secret_key = 'super secret key'

    Bootstrap(app)

    # Register Blueprints
    app.register_blueprint(main)
    app.register_blueprint(mod_search)
    app.register_blueprint(mod_firewall)
    app.register_blueprint(mod_vpn)
    app.register_blueprint(mod_bash)
    app.register_blueprint(mod_proxy)
    app.register_blueprint(mod_dashboard)
    app.register_blueprint(mod_for)
    app.register_blueprint(mod_login)
    # Initialize nav bar
    nav.init_app(app)

    # start web server
    run_server(app)
Example #7
0
from flask import Flask
from flask_appconfig import AppConfig
from flask_bootstrap import Bootstrap

from frontend import frontend
from nav import nav

app = Flask(__name__)

# We use Flask-Appconfig here, but this is not a requirement
AppConfig(app)

# Install our Bootstrap extension
Bootstrap(app)

# Our application uses blueprints as well; these go well with the
# application factory. We already imported the blueprint, now we just need
# to register it:
app.register_blueprint(frontend)

# Because we're security-conscious developers, we also hard-code disabling
# the CDN support (this might become a default in later versions):
app.config['BOOTSTRAP_SERVE_LOCAL'] = True

# We initialize the navigation as well
nav.init_app(app)

if __name__ == '__main__':
    app.run()