Esempio n. 1
0
def orm_configure(sanic, loop):
    db_config = {'database': 'sanic_example',
                 'host': 'localhost',
                 'user': '******',
                 'password': '******',
                 }

    # configure_orm needs a dictionary with:
    #    * the database configuration
    #    * the application/s where the models are defined
    orm_app = configure_orm({'loop': loop,  # always use the sanic loop!
                             'db_config': db_config,
                             'modules': ['library', ],  # list of apps
                             })
Esempio n. 2
0
def orm_configure(sanic, loop):
    # configure_orm defaults to the asyncorm.ini in same directory
    # the loop is required tho
    configure_orm(loop=loop)