from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand

migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()

from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand

migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


@manager.command
def create_db():
    """Creates the db tables."""
    db.create_all()


@manager.command
def drop_db():
    """Drops the db tables."""
    db.drop_all()


@manager.command
def create_admin():
    """Creates the admin user."""
    db.session.add(User("ad@min.com", "admin"))
    db.session.commit()

if __name__ == '__main__':
    manager.run()

Create create_db, drop_db and create_admin functions
Create create_db, drop_db and create_admin functions

  from project import app, db
  from project import models
  from flask.ext.script import Manager
  from flask.ext.migrate import Migrate, MigrateCommand
  
  migrate = Migrate(app, db)
  
  manager = Manager(app)
  manager.add_command('db', MigrateCommand)
  
+ 
+ @manager.command
+ def create_db():
+     """Creates the db tables."""
+     db.create_all()
+ 
+ 
+ @manager.command
+ def drop_db():
+     """Drops the db tables."""
+     db.drop_all()
+ 
+ 
+ @manager.command
+ def create_admin():
+     """Creates the admin user."""
+     db.session.add(User("ad@min.com", "admin"))
+     db.session.commit()
+ 
  if __name__ == '__main__':
      manager.run()
  
Create create_db, drop_db and create_admin functions
## Code Before:
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand

migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()

## Instruction:
Create create_db, drop_db and create_admin functions
## Code After:
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand

migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


@manager.command
def create_db():
    """Creates the db tables."""
    db.create_all()


@manager.command
def drop_db():
    """Drops the db tables."""
    db.drop_all()


@manager.command
def create_admin():
    """Creates the admin user."""
    db.session.add(User("ad@min.com", "admin"))
    db.session.commit()

if __name__ == '__main__':
    manager.run()
