Where should I implement flask custom commands (cli)
问题 Creating custom commands in flask needs access to the app, which is generally created in app.py like this: import click from flask import Flask app = Flask(__name__) @app.cli.command("create-user") @click.argument("name") def create_user(name): ... However, in order not to bloat my app.py, I want to put my custom commands in a separate file e.g. commands.py , but this doesn't work because the entrypoint to my project is app.py , so I'll have to import app in commands.py and import my commands