App management script

Coaster provides a Flask-Script-based with common management functions. To use in your Flask app, create a with this boilerplate:

from coaster.manage import manager, init_manager
from yourapp import app, db

def my_app_command()
    print "Hello!"

if __name__ == "__main__":
    # If you have no custom commands, you can skip importing manager
    # and use the return value from init_manager
    manager = init_manager(app, db)

To see all available commands:

$ python --help

Returns SQLAlchemy metadata and Alembic version table


Create database tables from sqlalchemy models


Drop database tables

coaster.manage.init_manager(app, db, **kwargs)[source]

Initialise Manager

  • app – Flask app object
  • kwargs – Additional keyword arguments to be made available as shell context
Parm db:

db instance


Create/Update alembic table to latest revision number


Supplies context variables for the shell