Python Blog Tutorial #2 - Flask User Authentication and Security

preview_player
Показать описание
Welcome back to part two of this blog tutorial series! In this video, I will be showing how to add security and authentication for blog application. For example; sign in, sign out, and create an account.

📄 Resources 📄

⭐️ Timestamps ⭐️
00:00 | Overview
01:01 | HTTP POST Method
04:04 | Getting Form Data
06:39 | SQLAlchemy Database Setup
10:22 | Creating The User Model
16:36 | Flask Login Setup
22:57 | Creating New Users
32:49 | Password Hashing
37:52 | Logging In Users
43:39 | Message Flashing
49:49 | Restricting Page Access

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰

🔗 Social Medias 🔗

🎬 My YouTube Gear 🎬

💸 Donations 💸
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
- Tech With Tim
- Python Tutorial
- Flask
- Blog Web App
- HTML
- Python Project

⭐️ Hashtags ⭐️
#TechWithTim #BlogTutorial
Рекомендации по теме
Комментарии
Автор

46:41 the cat starts in the background
46:49 Professionalism and compassion

phafid
Автор

You are doing an amazing job, I have a little suggestion for you, Python allows switch cases from 3.10. You can use that for the future 👍🏻

abhijithganesh
Автор

hey man loving the content. One thing I'd do differently - at 25:51 you're naming your variable (the results from the query) as email_exists. That variable name implies that it's a boolean imo, and even though email_exists still evaluates to False if there are no results (=None), it actually isn't equal to True if there are results (but rather, the resulting User object). That's why I'd prefer to call that object 'user', since it's more clear that it's an instance of the User model class that way.

walterppk
Автор

It is 8:45PM my sleeping time so I will watch it tomorrow .
👍👍🔥🔥🔥🔥🔥

prashantrawat
Автор

Tim Your channel is wonderful I'm Brazilian and I'm turning around here in subtitles haha.

simeoneholanda
Автор

theres a small mistake, thats why it didnt know your account after you restarted the code, in theres no underscore between SQL and ALCHEMY so its just it took me a long time to figure it out coz ive never done anything with databases before. hope it helps someone else with the same issue

edit: Nvm theres a different persons comment i just read that

not.stolen
Автор

Thanks, I've been looking everywhere for a tutorial on creating a flask login for my social media application.

emeraldthunder
Автор

I had a lot problems with creating database first mistake is
bad code in video:
= f'sqlite:///{{DB_NAME}}'

good code:
= f'sqlite:///{{DB_NAME}}'

if i change it i still cant create database and run server. For me help change in end of file __init__.py

bad code :

def create_database(app):
if not path.exists("website/" + DB_NAME):
db.create_all(app=app)
print("Created database!")

good code:
def create_database(app):
if not path.exists('website/' + DB_NAME):
with app.app_context():
db.create_all()
print('Created Database!')

I hope it help to someone who will have problems like me :D

liborhavranek
Автор

Another great video! Best flask tutorial

EduardoBello
Автор

It's not actually creating the database. That's why you had to make a second login at the end.

Nobodyday
Автор

You should also try the Ursina engine for python

alexmaterniuc
Автор

Tim, sweetie, may you never lack anything in this life🥺

the_bird_is_the_word.
Автор

Using bcrypt you can use a salt to hash a password meaning that someone can't decode password with a hash of a common password

bhagyajkumarbijukumar
Автор

Very good series Tim! Have you tried Django and what do you think of it compared to Flask?

AS-jdvr
Автор

hi, so i am trying to add a background, but am failing, could you do a little 5min segment on this in the next video?

davidawesome
Автор

"Werkzeug" is actually a German word meaning "tool". As a German it's pretty funny to me how you pronounce it xD

Toni-nwdk
Автор

werkzeug is tool in german (and danish kinda, where it is værktøj)

mrchow
Автор

If you are doing this in 2024 might get an error fro the hash method 37:35 anyway this works:
password=generate_password_hash(password1, method='pbkdf2:sha256')

leophelan
Автор

hi Tim how you doin?
please explain more about SQLAlchemy...
tnx u

mamadturaan
Автор

How many flask tutorials are you gonna make?

Rachit_