#NEWLINE# @ manager . command #NEWLINE# def create_db( ) : #NEWLINE# #INDENT# 'Creates application DB.' #NEWLINE# from models import DB #NEWLINE# url = app . config . get ( 'SQLALCHEMY_DATABASE_URI' , 'sqlite://' ) #NEWLINE# if url . startswith ( 'sqlite:////' ) : #NEWLINE# #INDENT# path = url [ 10 : ] #NEWLINE# if ( not os . path . exists ( path ) ) : #NEWLINE# #INDENT# os . makedirs ( path ) #NEWLINE# #UNINDENT# #UNINDENT# DB . create_all ( ) #NEWLINE# DB . session . commit ( )