def initialize(config): config_app(app, config) from dessert.models import * print "Drop all tables" db.drop_all() print "Create all tables" db.create_all()
def privilege(config, email, privilege): config_app(app, config) from daimaduan.models import User user = User.objects(email=email).first() if not user: print "User can not be found." else: user.privilege.privilege = int(privilege) user.save() print "Modification successed."
def test(config): config_app(app, config) dispatch_handlers(app) dispatch_apps(app) app.run(host='0.0.0.0')