def dbcreate(t): from vuuvv.core import Application app = Application(__name__) with app.test_request_context(): app.connect_database(reflect_all=True) __import__("db.schema")
def runserver(t): from vuuvv.core import Application app = Application(__name__) app.run()
def run(*args, **kw): app = Application(__name__) app.run(*args, **kw)
# #app = make_app() # #@app.before_first_request #def init_database(): # from flask import current_app as app, g # config = app.config # args = [config[name] for name in ('DRIVERNAME', 'USERNAME', 'PASSWORD', 'HOST', 'PORT', 'DATABASE')] # url = URL(*args) # g.db_engine = create_engine(str(url), echo = config['DEBUG']) # g.db_meta = MetaData() # g.db_session = scoped_session(sessionmaker(sutocommit=False, autoflush=False, bind=engine)) # #@app.teardown_request #def remove_db_session(): # g.db_session.remove() # #@app.route("/") #def hello(): # print app.url_map # return "Hello! World!!" # #app.run() import sys sys.path.insert(0, "../..") from vuuvv.core import Application app = Application(__name__) app.run()
import sys sys.path.insert(0, "../..") from vuuvv.core import Application app = Application(__name__) with app.test_request_context(): app.connect_database(reflect_all=True) __import__("db.schema")