-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
add example of how to set up with init_app method #302
add example of how to set up with init_app method #302
Conversation
|
||
from flask_migrate import Migrate | ||
|
||
migrate = Migrate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd want the db
also initialized up here.
db = SQLAlchemy()
migrate = Migrate()
docs/index.rst
Outdated
|
||
def create_app(): | ||
... | ||
# instantiate your db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "initialize" your db.
docs/index.rst
Outdated
... | ||
migrate.init_app(app, db) | ||
... | ||
# import your models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The models do not necessarily need to be imported here, and a lot of people prefer to not do imports inside functions, so I would remove this comment and leave it up to the developer to decide where to do the import.
Thanks for the addition, Kyle. Take a look at my comments and let me know what you think. |
Agreed on all points, will push up the edits later tonight.
|
Made those edits and I added a docstring for the |
Thanks, Kyle! |
No description provided.