It's often necessary to run manage commands in other web frameworks.
For example, Flask comes with an "official" cli called flask as of 0.11. We often need to run db migrations like flask db upgrade. Other frameworks like Pymarid has their own management cli too.
To invoke those commands with Zappa now, people need to figure out which python function correspond to a command, and call it with invoke.
Since this is a common requirement, it would be nice for Zappa to support it out of the box.
Possible Fix
I think there can be 2 ways to support this:
add a zappa sub-command to execute arbitrary shell commands, like zappa shell ./manage.py db upgrade. The handler can simply run the command in a subprocess. It won't be more insecure than invoke.
support other frameworks like we do for Django now. This involves more branches in the lambda handler, but feels more controlled. E.g.: zappa manage django shell, zappa manage flask db upgrade. Apparently we'll need a branch for each framework, which can be significantly more work than the first approach.
I'm happy to make a PR if you're OK with any of them.
Context
It's often necessary to run manage commands in other web frameworks.
For example, Flask comes with an "official" cli called
flask
as of 0.11. We often need to run db migrations likeflask db upgrade
. Other frameworks like Pymarid has their own management cli too.To invoke those commands with Zappa now, people need to figure out which python function correspond to a command, and call it with
invoke
.Since this is a common requirement, it would be nice for Zappa to support it out of the box.
Possible Fix
I think there can be 2 ways to support this:
zappa shell ./manage.py db upgrade
. The handler can simply run the command in a subprocess. It won't be more insecure thaninvoke
.zappa manage django shell
,zappa manage flask db upgrade
. Apparently we'll need a branch for each framework, which can be significantly more work than the first approach.I'm happy to make a PR if you're OK with any of them.