Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created January 22, 2020 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/afaad17bb1c55ac8c08c28dea3d00ee2 to your computer and use it in GitHub Desktop.
Save Porter97/afaad17bb1c55ac8c08c28dea3d00ee2 to your computer and use it in GitHub Desktop.
from flask_migrate import flask-migrate
#...
migrate = Migrate(app, db)
@app.shell_context_processor
def make_shell_context():
return dict(db=db, User=User, Role=Role,
Permission=Permission)
@app.cli.command()
def deploy():
"""Running all of our deployment operations."""
# migrate database to latest revision
upgrade()
# create or update user roles
Role.insert_roles()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment