def createdb(): """init mysql tables""" init_app() try: APP_DB.create_all() except: pass u = User("manager", "*****@*****.**", "123456", "0") u.confirmed = True APP_DB.session.add(u) APP_DB.session.commit()
def web_start(): init_app() run_application()
def setUp(self): self.db_fd, webapp.app.config['DATABASE'] = tempfile.mkstemp() webapp.app.config['TESTING'] = True self.app = webapp.app.test_client() webapp.init_app()
from webapp import init_app app = init_app() if __name__ == "__main__": app.run(debug=True)
#!/usr/bin/python from webapp import app, init_app app.config["DATABASE"] = "./database.db" init_app() app.run(host="0.0.0.0", port=80, debug=True)