How to use the summer.app.create_app function in summer

To help you get started, we’ve selected a few summer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaowhen / summer / tool / initdb.py View on Github external
def init_db():
    app = create_app('product')
    _context = app.app_context()
    _context.push()
    with closing(connect_db()) as db:
        with open('./summer/schema.sql', mode='r') as f:
            db.cursor().executescript(f.read())
            db.commit()
github gaowhen / summer / app.py View on Github external
# -*- coding: utf-8 -*-

import sys

reload(sys).setdefaultencoding('utf-8')

from summer.app import create_app

app = create_app('product')

if __name__ == '__main__':
    app.run()
github gaowhen / summer / tool / fillup.py View on Github external
def fill_db():
    app = create_app('product')
    _context = app.app_context()
    _context.push()

    fill_post()
    fill_draft()
github gaowhen / summer / manage.py View on Github external
# -*- coding: utf-8 -*-

from flask.ext.script import Manager
from summer.app import create_app

app = create_app('product')

manager = Manager(app)


@manager.command
def web():
    app.run()

if __name__ == "__main__":
    manager.run()