How to use the tblib.model function in tblib

To help you get started, we’ve selected a few tblib 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 shiyanlou / louplus-python / taobei / tbmall / app.py View on Github external
from importlib import import_module

from flask import Flask
from tblib import model

from . import config
from .handlers import init as init_handlers


app = Flask(__name__)
app.config.from_object(config.configs.get(app.env))


model.init(app)
import_module('.models', __package__)

init_handlers(app)


if __name__ == '__main__':
    from gevent import pywsgi

    server = pywsgi.WSGIServer(app.config['LISTENER'], app)
    print('gevent WSGIServer listen on {} ...'.format(app.config['LISTENER']))
    server.serve_forever()
github shiyanlou / louplus-python / taobei / tbuser / app.py View on Github external
def init_model(app):
    from importlib import import_module
    from tblib import model

    model.init(app)

    import_module('.models', __package__)
github shiyanlou / louplus-python / taobei / tbbuy / app.py View on Github external
from importlib import import_module

from flask import Flask
from tblib import model

from . import config
from .handlers import init as init_handlers


app = Flask(__name__)
app.config.from_object(config.configs.get(app.env))


model.init(app)
import_module('.models', __package__)

init_handlers(app)


if __name__ == '__main__':
    from gevent import pywsgi

    server = pywsgi.WSGIServer(app.config['LISTENER'], app)
    print('gevent WSGIServer listen on {} ...'.format(app.config['LISTENER']))
    server.serve_forever()