Using Databases With Flask - Python and Flask #8

preview_player
Показать описание
In this video I'll show you how to start using Databases with Flask and Python.

We'll be creating a database to keep track of our Friends list. We'll use sqlite3 and sqlalchemy for the database.

Using a database in flask is fairly easy, you just add sqlalchemy to your app, then create a model that defines your database table and columns. Then adding and retrieving things from the database is trivial.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Flask Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

This force is very strong with this one. Indeed a Jedi of his craft. Indeed is he.

df
Автор

Just thought i'd thank you for carrying me through one of my CS assignments, cheers, I'd be in the bin without these videos

takodamundy
Автор

I had problems with understanding flask, You made it so easy for me. I now get it .. From the botom of my heart, Thank you... Happy new year

faithnjoki
Автор

very simple and easy to follow tutorial, thank you very much

kwabenankyi
Автор

I had been waiting for this video for so long, finally

Flamiooo
Автор

Say that your friends.html page has multiple types of input and you had another .html page that has only one input variable that also posts to your friends.html. If you were to have two different .html pages going to your friends.html with the post method, how could you distinguish between them? Say, friends.html would update the database and itself but the other .html would bring only a friends name and you were to have a dropdown menu which default value needs to be that posted friends name. How would you do that?

danielhansen
Автор

I get the following error a 11min in when you are using the gitbash terminal to create the "db ImportError: cannot import name 'db' from 'app' (C:\my_flask\app.py)"

jean-paullavalley
Автор

Thank you for sharing your knowledge Sir we love you <3

TechWithSabri
Автор

I'm currently at 12:20 and I've followed all of these steps and get errors so I've decided to follow some troubleshooting steps on StackOverflow to the point where.I do db.create_all() I get no errors. However, for some reason the database doesn't appear on my file explorer nor my IDE project explorer (PyCharm). Has the database been created? Thanks. UPDATE - can confirm the database was created as searched for 'friends.db' in finder on Mac.

cricketer
Автор

If I made a User model and created it via de Python Interpreter. How can I add a new rows? For example, if you wanted to add a row 'Gender' to your existing database after you did the command db.create_all()?

antoinekikkers
Автор

can you point to where is this database series listed since I could not find sqlite database related coverage in the Flask course on your website.

chotagunnu
Автор

Explained really clearly, thanks alot!

benjaminodriscoll
Автор

Hi, thanks for your easy-to-follow videos, could you do a video for searching through a database with Flask?

tochukwunwokolo
Автор

It’s showing “ there was an error adding your friend...” How to resolve it?

pikachubooo
Автор

When someone put the details in our subscribe web page, how to store that information in database?

parthdutta
Автор

Hi, i get an error when doing db.create_all(). It states that i have to give an app context something like app.app_context()?

wimvangeyt
Автор

It would be cool to inform the last commit on starting the tutorial - so we pick up exactly where you are starting from.

kshitijmathur
Автор

I'm having an error when tyring to import db >>> from app import db
UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:". Can someone help me pls?

supersentaimexicano
Автор

what if I have multiple apps in the Blueprint structure, how can I create a database with its model for each app separately ?

MohamedAshraf-zsnv