Esempio n. 1
0
def load_json(table_name, json_name):
    """
    # TODO: cm choices support
    :param table_name: a model's table name to load json to, possible values are 'patients' and 'payments'
    :param json_name: json name 0_0
    """
    app = mapp.create_app('devel.db')
    with app.app_context():
        mapp.import_json(table_name, json_name)
Esempio n. 2
0
def embed(dbname: str):
    """
    devel: embed inside app context, with database models in globals()
    """
    import models
    db = models.db
    Patient = models.Patient
    Payment = models.Payment
    from IPython import embed as iembed
    app = mapp.create_app(dbname)
    with app.app_context():
        iembed()
Esempio n. 3
0
def app():
    app = create_app(dbname='test.db')
    return app
Esempio n. 4
0
from mapp import create_app

app = create_app()

if __name__ == '__main__':
    # nginx + uwsgi
    app.run(host='0.0.0.0', debug=app.config['DEBUG'], threaded=True)
Esempio n. 5
0
def launch(host: str, port: int):
    """
    launch the web server
    """
    app = mapp.create_app('devel.db')
    app.run(host, port)