Beispiel #1
0
    def __init__(self):

        #check if db exists
        if not database_exists(DB_URL):
            print '-'*10
            print 'Initializing db at '+ DB_URL
            init_db()
            print 'successfull'
            print '-'*10

        self.db_session = db_session

        super(Ming, self).__init__()
Beispiel #2
0


#@app.cli.command()
def initdb():
    """Initialize the database."""

    # try connect to db
    # show its structure

    #else
    init_db()

    print '-'*10
    print 'Initializing db at '+ DB_URL

    return







if __name__ == '__main__':

    if not database_exists(DB_URL):
        initdb()

    app.run(debug=True)