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

Remove db creation from app.py file in favor of migrations #145

Conversation

LUS24
Copy link
Contributor

@LUS24 LUS24 commented Feb 8, 2024

No description provided.

Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rest-apis-flask-python ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 8:00am

@jslvtr
Copy link
Contributor

jslvtr commented Feb 13, 2024

Thanks @LUS24! I think there might be a few more places to remove the code, some lectures in section 12 still have the obsolete code 🤔

@LUS24
Copy link
Contributor Author

LUS24 commented Mar 4, 2024

Thanks @LUS24! I think there might be a few more places to remove the code, some lectures in section 12 still have the obsolete code 🤔

I didn't find any references beyond section 9:

...
...
docs\docs\08_flask_jwt_extended\12_token_refreshing_flask_jwt_extended\start\conftest.py:
  24  def jwt(app):
  25:     with app.app_context():
  26: 

  26          access_token = create_access_token(identity=1)

  31  def admin_jwt(app):
  32:     with app.app_context():
  33: 
  33          access_token = create_access_token(

docs\docs\09_flask_migrate\02_add_flask_migrate_to_app\README.md:
  35  
  36: with app.app_context():
  37: 

  37      db.create_all()

  44  ```py
  45: with app.app_context():
  46: 
  46      db.create_all()

docs\docs\09_flask_migrate\02_add_flask_migrate_to_app\start\app.py:
  94  
  95:     with app.app_context():
  96:         import models  # noqa: F401
  97  

That last appearance is the one that instructs students to remove it in favor of the migrations.

Have you seen that code in some other file that I've missed?

@jslvtr jslvtr merged commit 998635f into tecladocode:develop Apr 4, 2024
2 of 3 checks passed
@jslvtr jslvtr mentioned this pull request Jun 21, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants