<s> from app import create_app , config <EOL> from app . database import db , populate_db <EOL> from flask . ext . migrate import Migrate , MigrateCommand <EOL> from flask . ext . script import ( <EOL> Server , <EOL> Shell , <EOL> Manager , <EOL> prompt_bool , <EOL> ) <EOL> def _make_context ( ) : <EOL> return dict ( <EOL> app = create_app ( config . dev_config ) , <EOL> db = db , <EOL> populate_db = populate_db <EOL> ) <EOL> app = create_app ( config = config . dev_config ) <EOL> migrate = Migrate ( app , db ) <EOL> manager = Manager ( app ) <EOL> manager . add_command ( '<STR_LIT>' , Server ( ) ) <EOL> manager . add_command ( '<STR_LIT>' , Shell ( make_context = _make_context ) ) <EOL> manager . add_command ( '<STR_LIT>' , MigrateCommand ) <EOL> @ manager . command <EOL> @ manager . option ( '<STR_LIT>' , '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> def create_db ( num_users = <NUM_LIT:5> ) : <EOL> """<STR_LIT>""" <EOL> db . create_all ( ) <EOL> populate_db ( num_users = num_users ) <EOL> @ manager . command <EOL> def drop_db ( ) : <EOL> """<STR_LIT>""" <EOL> if prompt_bool ( '<STR_LIT>' ) : <EOL> db . drop_all ( ) <EOL> @ manager . command <EOL> def recreate_db ( ) : <EOL> """<STR_LIT>""" <EOL> drop_db ( ) <EOL> create_db ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> manager . run ( ) </s>
