def create_base_app():
    """Creates base app with sensible defaults.
    """
    app = Flask("itgetlink")
    CORS(app)
    config = AppConfig()
    default_config = "itgetlink.backend.default_config"
    config.init_app(app, default_settings=default_config)
    db.init_app(app)

    migrate_dir = os.path.join(os.path.dirname(__file__), "migrations")
    Migrate(app, db, directory=migrate_dir)

    sentry.init_app(app)
    return app
Example #2
0
def CreateApp(configfile=None):
    from flask import Flask
    from flask.ext.appconfig import AppConfig
    from rq_dashboard import RQDashboard
    from flask_debug import Debug
    from flask.ext.rq import RQ

    result = Flask(__name__)
    AppConfig(result, default_settings="gir.config", configfile=configfile)
    result.config['RQ_DEFAULT_URL'] = result.config['REDIS_URL']
    RQDashboard(result)
    Debug(result)
    RQ(result)
    return result
Example #3
0
def create_app(configfile=None, default_settings=True):
    app = Flask(__name__)
    # Configure app
    AppConfig(app, configfile=configfile, default_settings=default_settings)
    # Open db model
    from greidinet.model import db
    db.init_app(app)
    # DEBUG
    app.test_request_context().push()
    db.drop_all()
    db.create_all()
    # Use Bootstrap
    Bootstrap(app)
    # Import blueprints
    #from greidinet.simplegui import simplegui
    #app.register_blueprint(simplegui)
    # REST api
    from greidinet.restapi import restapi
    restapi.init_app(app, flask_sqlalchemy_db=db)
    restapi.create_apis()
    

    return app
Example #4
0
# -*- coding: utf-8 -*-
"""Extensions module."""

from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()

from flask.ext.migrate import Migrate
migrate = Migrate()

# Change this to HerokuConfig if using Heroku.
from flask.ext.appconfig import AppConfig
config = AppConfig()
Example #5
0
def create_app():
    app = Flask(__name__)
    AppConfig(app, default_settings="mishapp_api.default_config")
    db.init_app(app)
    app.register_blueprint(disaster_api)
    return app
Example #6
0
def create_app(configfile=None):
    new_app = Flask(__name__)
    AppConfig(new_app, configfile)
    return new_app