#9 Python Flask Tutorial for Beginners - Flask SQLAlchemy Postgres Tutorial - Postgres Flask

preview_player
Показать описание
You'll learn several new things in this video. So make sure to watch it till the end.

Videos in Flask Tutorial Series:
#0 - Flask App Intro -

#1 - Flask Installation & Best VSCode Extensions for Python -

#2 - Layout & Website Structure in Flask App -

#3 - Adding Bootstrap, Custom CSS, JS in Flask App -

#4 - Creating Navbar Using Bootstrap v5 in Flask App -

#5 - Bootstrap 5 Cards in Flask App -

#6 - Creating Slider with Bootstrap 5 in Flask App -

#7 - Register & Login Page with Flask WTF -

#9 - Flask SQLAlchemy Postgres Tutorial -

#10 - Flask Bcrypt Authentication -

#11 - Flask Login Tutorial - Manage User Session in 3 Steps -

#13 - Flask Upload Image - Easily Upload Image to Database -

#14 - Flask SQLAlchemy Relationship - One to Many Relation -

#15 Deploy Flask App to Heroku - Flask Tutorial Series - Gunicorn Server -

#16 Deploy Flask App to AWS -

For beginners SQLite is a good choice but if you want to deploy your app online & want to scale your application later at some point then creating a Postgres database is preferable.
That's after covering SQLAlchemy SQLite in my earlier video, I am covering SQLAlchemy Postgres in this one.
So, these are the commands that you are going to be needing to work with Postgres:
1. Create a new user
create user 'username' with password 'password';
2. Assign roles and attributes to user
alter user 'username' with superuser;
alter user 'username' with createdb;
3. Switch user
\c 'database name' 'username'
4. Create database with new user
create database 'database name';
5. \du - display all users
6. \l - list all tables in a database
7. \q - quit psql shell.

Please support my efforts by contributing through Patreon:

Please Like, Share and Subscribe to Code Jana.
Thanks for Watching & I'll see you in the next one.
Рекомендации по теме
Комментарии
Автор

You r really great..awesome..It is working perfectly..thanks a lot.

bk
Автор

While importing db it throws ModuleNotFoundError

saravanakumar-scds
Автор

in Command line: "psql" asks to login, but seems it only accepts default postgres user via
"psql -U postgres"

How can I setup, so when I type "psql" i'm prompted with my created user?

I created user "yo"
when I "psql -U yo" and enter password:
"psql: error: FATAL: database "yo" does not exist" - DATABASE, not user. What the hell?

Sorry, newbie in postgres, haven't eaten for half day.

yomajo
Автор

HI, Instead of getting all the columns in GET request, How could I get only specific columns from the postgres table?

vijeandran
Автор

I get this error when I try to connect the user to the database: Peer authentication failed for user "myuser".

nobodyeverybody
Автор

I can't get to SQL shell on mac. What should I do instead?

adrianmahdavian
Автор

Hi, for some reason when I connected today to VS to keep on working on the project, some libraries that we imported such as flask_bycrypt, flask_login, flask_email have a yellow line below them with the message saying " Import "flask_sqlalchemy" could not be "....I testes the app and it is working...so not sure what exactly the issue is...help pls

andrescardona