▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My UA-cam Channel: bit.ly/3ig2eJn bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/2L1jBl5
Hi John. I really enjoy your tutorials, but I can't understand why you used generate_password_hash on the same password twice (first in "class User" then in "add_user" function). Wouldn't it be enough just to hash it in add_user function and then send it to the database?
You can just assign it to the password attribute of your User() object and it will make use of the property decorator you made in the previous video to hash it. He probably did it like this just in case people didnt see the previous video.
Indeed : user = User(name=form.name.data, email=form.email.data) user.password = form.password_hash.data suffices... Explanation : user = User(name=form.name.data, email=form.email.data,password=form.paswword_hash.data) Does NOT rely on @password.setter, so the password is just passed as is, whereas the first method does.
Necro-ing your video comments, but would be cool if you could provide some advice on how to use a more computational expensive hashing algo, sha-256 is a bit quick!
I remember seeing a Corey Schafer video where he went through one that would increase in computational difficulty after every incorrect password attempt. I forget the video but it is in his Flask series. It's a few years old though.
Muchas gracias John, siempre logro desenredar mis enredos ya vamos por el video 14 y no se cuantos errores e cometido pero siempre logro terminar los videos de manera exitosa a veces tengo que usar otros comandos no entiendo muy bien por que, ejemplo flask --app hello --debug run / flask --app hello db migrate -m no he podido hacer los comentarios pero ahí vamos....Thank you teacher sending you good vibes.... here practice your spanish hahahah
If you get a jinja2 UndefinedError please check the database mosel Users =>password_hash column should match what is taken as argument in password and verify_password function
Everything was going well up to and including lesson #13 (completed last night). Today, before starting lesson #14, I started flask, and when trying to load 'localhost:5000/user/add', I get the below error message, and I have no idea how to fix the problem. :( EDIT: Never mind. I still pressed ahead with this video, and the problem was solved after watching the first 3 minutes of this video. I just need to push the migration into the database. I will leave this message here, in case some future learner has the same problem. sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1054, "Unknown column 'users.password_hash' in 'field list'") [SQL: SELECT users.id AS users_id, users.name AS users_name, users.email AS users_email, users.favorite_color AS users_favorite_color, users.date_added AS users_date_added, users.password_hash AS users_password_hash FROM users ORDER BY users.date_added] (Background on this error at: sqlalche.me/e/14/e3q8)
▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My UA-cam Channel:
bit.ly/3ig2eJn bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶️ Get The Code
bit.ly/2L1jBl5
Thank you sir thank you so much❤❤❤ 😇😇😇😇
I think this playlist is the best playlist
Ever
Thank you!
You are a great teacher. Best 27$ Ive ever spent!
Wow, thanks!
your pronunciation of werkzeug is really good!! its very close to the actual german pronunciation :)
Oh wow! Lucky I guess!
Was looking for this only and this popped up. Thanks a lot.
Glad I could help!
Hi John. I really enjoy your tutorials, but I can't understand why you used generate_password_hash on the same password twice (first in "class User" then in "add_user" function). Wouldn't it be enough just to hash it in add_user function and then send it to the database?
You can just assign it to the password attribute of your User() object and it will make use of the property decorator you made in the previous video to hash it. He probably did it like this just in case people didnt see the previous video.
Indeed :
user = User(name=form.name.data, email=form.email.data)
user.password = form.password_hash.data
suffices...
Explanation :
user = User(name=form.name.data, email=form.email.data,password=form.paswword_hash.data)
Does NOT rely on @password.setter, so the password is just passed as is, whereas the first method does.
Necro-ing your video comments, but would be cool if you could provide some advice on how to use a more computational expensive hashing algo, sha-256 is a bit quick!
I remember seeing a Corey Schafer video where he went through one that would increase in computational difficulty after every incorrect password attempt. I forget the video but it is in his Flask series. It's a few years old though.
Muchas gracias John, siempre logro desenredar mis enredos ya vamos por el video 14 y no se cuantos errores e cometido pero siempre logro terminar los videos de manera exitosa a veces tengo que usar otros comandos no entiendo muy bien por que, ejemplo flask --app hello --debug run / flask --app hello db migrate -m no he podido hacer los comentarios pero ahí vamos....Thank you teacher sending you good vibes.... here practice your spanish hahahah
haha thanks!
If you get a jinja2 UndefinedError please check the database mosel Users =>password_hash column should match what is taken as argument in password and verify_password function
man a please answer how to use adsense with a django app
huh? Adsense gives you html code...just paste it on any page of the site you want.
hello were to find the source code
Pinned comment
can you make video on how to make todo app using flask
Sure, but I have videos on flask crud already...
@@Codemycom Can we get touch in Gmail?
@@samkth1 There's a contact form on codemy.com but you're talking to me here now
Nice!
Thanks!
cool
Thanks!
hi john elder
HI sandeep sarun
Everything was going well up to and including lesson #13 (completed last night). Today, before starting lesson #14, I started flask, and when trying to load 'localhost:5000/user/add', I get the below error message, and I have no idea how to fix the problem. :( EDIT: Never mind. I still pressed ahead with this video, and the problem was solved after watching the first 3 minutes of this video. I just need to push the migration into the database. I will leave this message here, in case some future learner has the same problem.
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1054, "Unknown column 'users.password_hash' in 'field list'")
[SQL: SELECT users.id AS users_id, users.name AS users_name, users.email AS users_email, users.favorite_color AS users_favorite_color, users.date_added AS users_date_added, users.password_hash AS users_password_hash
FROM users ORDER BY users.date_added]
(Background on this error at: sqlalche.me/e/14/e3q8)
Ha, yeah I was about to suggest that...