Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flask_script is not supported any more, I switched to Flask CLI but I can't run make database._migrate #22

Open
GOussama opened this issue Sep 17, 2022 · 0 comments

Comments

@GOussama
Copy link

I tried a "make database._migrate" but I got an error because flask_script is not supported any more, I switched to Flask CLI
And my manage.py is as follow.


from flask import Flask
from flask.cli import FlaskGroup
from flask_migrate import Migrate

import config
from models import db

server = Flask(__name__)
server.debug = config.DEBUG
server.config["SQLALCHEMY_DATABASE_URI"] = config.DB_URI
db.init_app(server)

migrate = Migrate()

migrate.init_app(server, db)
#migrate = Migrate(server, db)

cli = FlaskGroup(server)

if __name__ == "__main__":
    cli()

How ever when I run : make database._migrate which is ( docker-compose run --rm server python src/manage.py db migrate )
I get

Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory. make: *** [database.migrate] Error 2

Could help with that please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant