Python Flask Tutorial: Full-Featured Web App Part 7 - User Account and Profile Picture

preview_player
Показать описание
In this Python Flask Tutorial, we will be finishing our user account page so that a user can update their information. We will also be adding the ability for a user to upload a profile picture. We will learn how we can resize this image so that it doesn't take up much room on our server. Let's get started...

The code for this series can be found at:

The snippets used in this video can be found here:

The default profile picture I am using can be found here (Unsplash License):

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python #Flask
Рекомендации по теме
Комментарии
Автор

I'm in my final semester of my degree right now! and the first thing I am going to do as soon as I land a job is to support this channel! This series is just AMAZING!

MistaT
Автор

For anyone wanting to delete the previous profile picture while adding a new one, I added this just before the return statement in the save_picture function:

prev_picture = os.path.join(app.root_path, 'static/profile_pics', current_user.image_file)
if os.path.exists(prev_picture):
os.remove(prev_picture)

kirkkenney
Автор

In 2024, this is still the best Flask tutorial on the Internet due to its comprehensive coverage of topics, clear explanations, and up-to-date practices.

codewithgedo
Автор

Corey! I have an interview tomorrow wish me luck! If I get this job the first thing I'll do is support you through Patreon with my first salary. You have taught things so efficiently that no professor has ever taught in these semesters for graduation. You're such a kind person for teaching such valuable content with this brilliant quantity without charging a penny!

soumyajitdey
Автор

loving this tutorial!
i added the code to delete the old profile pic when updating with a new one. this is the if statement in the account function in routes.py


```
if form.picture.data:
old_pic = current_user.image_file
picture_file =
current_user.image_file = picture_file
if old_pic != 'default.jpg':
os.remove(os.path.join(app.root_path, 'static/profile_pics', old_pic))
```

ian_senior
Автор

Watching this series 4 years later and I strongly recommend. Learning a lot.

arseneawounou
Автор

The pacing of these tutorials and your explanations are just incredible! Shared the series with my Python friends :)

rusinsr
Автор

Fantastic series, Corey. Pacing, content, thoroughness, and execution is just great. Thank you for the quality content!

tylmomendog
Автор

I really love the fact that whenever I run into any error following these amazing tutorials, the error has been asked and answered in the comments :)

arinzealex
Автор

Mr. Schafer is like a teaching machine! Always keeps all things in mind and never stutters or says anything unnecessary!

kizernis
Автор

Thank you for the best content when it comes to python and Flask tutorials.
I tried to learn Flask a little too early in my programming journey and when i was stuck i started to search for another tutorial instead of improving my skills.
I came back crawling to you Corey QUICK.
Thank you!

ryszardkalisz
Автор

you're a !
Your tutorials are awesome ! keep the good work !
If you could put a series about Laravel that would be dope !
You got some high quality skills in teaching !
Thanks a lot !

chakibbrikcisid
Автор

Seriously been searching for days for a complete flask webapp build tutorial. This and from sentdex were the BEST!

serta
Автор

This is has become on of the best code tutorials I've ever watched on Youtube!

AbhishekNigam
Автор

Another LEGENDARY vid!

When I saw you install Pillow, I thought to myself "Python is like the car, and these extensions are like aftermarket parts... " :)

lightninginmyhands
Автор

I like how you started referencing where we set the variable in the past, helps keep track of structure better

Thattyguy_
Автор

One of the best tutorials on anything i've ever watched

RandomShowerThoughts
Автор

Corey, Your python videos are really amazing. I started python programming after a decade and I'm into it now. But my job is mostly in automation testing. Wanted to change to development and picked your series. Can't stop in btw, yesterday I started and now I'm in part 7. With this video reference, I can able to build the website. Amazing Work!!

vinodhr
Автор

I have no experience using any backend framework, except some basic django... 
I did not expect such an amazing quality from a YouTube tutorial, which is free!
thankyou!
this is an amazing series!
you're god sent for broke students!

ixwliui
Автор

Hello, my name is Pedro and I live in São Paulo, I am writing this text to thank you immensely because you are not only helping me in my professional life but also in my academic life. Keep being this amazing person that you are and may there be others like you over the years, thank you very much.

PedroHenrique-nezm