Skip to content

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

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

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
@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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy