コード例 #1
0
ファイル: __init__.py プロジェクト: pprolancer/orangeapp
    return jsonify_status_string(message="Success", status='success')


@general.route('/test/secret', methods=['GET'])
@login_api_key
@login_required()
def api_secret_fortestonly():
    return jsonify_status_string(message="Success", status='success')


@general.route('/', methods=['GET'])
def index():
    return redirect('index.html')


LOG_FILE_PATH = config.getpath('app', 'LOG_FILE_PATH')
STATIC_PATH = config.getpath('app', 'STATIC_PATH')
API_URL_PREFIX = config.get('app', 'API_URL_PREFIX')

BLUEPRINTS = [
    (general, ''),
    session_rest
]


def register_blueprints(app, blueprints):
    for blueprint in blueprints:
        prefix = API_URL_PREFIX
        if isinstance(blueprint, tuple):
            blueprint, prefix = blueprint
        app.register_blueprint(blueprint, url_prefix=prefix)
コード例 #2
0
ファイル: manage.py プロジェクト: pprolancer/orangeapp
#!/usr/bin/env python
from migrate.versioning.shell import main

from orange.myproject.conf import config

if __name__ == '__main__':
    SQLALCHEMY_DATABASE_URI = config.get('db', 'SQLALCHEMY_DATABASE_URI')
    SQLALCHEMY_MIGRATE_REPO = config.getpath('db', 'SQLALCHEMY_MIGRATE_REPO')

    main(url=SQLALCHEMY_DATABASE_URI, repository=SQLALCHEMY_MIGRATE_REPO,
         debug=False)