Python Django Tutorial: Full-Featured Web App Part 8 - User Profile and Picture

preview_player
Показать описание
In this Python Django Tutorial, we will be creating a user profile that extends the built-in Django User model. We will then use this user profile to store profile pictures for each user. We will also be learning how to set the MEDIA_ROOT, MEDIA_URL, and also make our static files accessible through our URL patterns. Finally, we will create a receiver function for a Django signal that will make sure our profiles are created when a user first registers. Let's get started...

The code for this series can be found at:

Django Static File Docs:

✅ 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 #Django
Рекомендации по теме
Комментарии
Автор

Quick heads up for 14:00. os is not imported by default in my case, as BASE_DIR uses pathlib instead of os.
Add the extra line manually:
import os

HarmenHoek
Автор

I have a long-term university-paid subscription to Lynda and have spent many, many hours there learning code. It's a great service, and I love it, BUT THIS VIDEO SERIES IS BETTER than any series on Django I've found there!!!! You have filled in a number of "blanks" left by other tutorials and I feel much more confident that I actually understand the framework now.

mishterpreshident
Автор

You are legitimately the best teacher I've seen on Youtube. With other tutorials here on Youtube I follow along but feel like I don't actually learn much. But with your explanations it's easy for me to follow along and apply the knowledge into my own projects!

christianramirez
Автор

At first I thought Django was a bit complicated.. Corey made it seem easy and my confidence has grown.

SiphoMkhwanazi
Автор

0:22 - profile model, one to one relationship
3:06 - image field
3:47 - __str__ method
4:56 - migration
5:44 - install Pillow
6:36 - add profile to admin page
9:06 - interact with profile on shell
12:41 - setting media root, media url
18:22 - profile template
20:57 - add media route into project url pattern
24:38 - upload default.jpg
26:20 - django signals
32:10 - import signals into ready function of apps.py

congcuongnguyen
Автор

I'm a student in Ghana(West Africa). I don't have the means to contribute to the patreon....but surely, I'm going to make so many others wanting to learn python and Django/flask hear of you.
I'm so grateful for the impact you're having on me.

cs_patterson
Автор

I've been looking for a sensible explanation for this bit for roughly 4 months now, and I just wanted to express my absolute awe.

Absolutely professional, handy with the ol' typewriter, no rubbish code and moreover no rubbish small talk.

You sir, are a God among ants within the django tutorials realm, hands down. An instant subscription was made, obviously.

Thank you ever so much for taking the time to make these videos ^_^

mikkeljrgensen
Автор

You are the best ! I am in a coding boot camp and I feel your videos are much better than boot camp! Will pass on money as soon as I start making some !

reenadangi
Автор

This tutorial is the best tutorial i hve seen so far. its the best. paid contents dont even have the explanations. I will donate when i land my first job as a django dev. thanks a ton corey

akashgkrishnan
Автор

i found that putting the picture of who displayed the comment looks much nicer, so in the home.html right above the post.author if we add the line <img src="{{ post.author.profile.image.url }}" width="30" height="30"> the post section looks a bit nicer, i am new at this but thanks to Corey i was able to understand some concepts.

Eddyyc
Автор

I just sent 15€ from paypal for your amazing job. I did few tutorials and yours is so clear.
Thanks again :)

crimcrow
Автор

Firstly, Great tutorial Corey! Simply the best! For those of you having issues where the profile isn't saving or the default image isn't showing up, please make sure to tab properly. In the apps.py file in the users directory, please make sure that 'def ready(self):...' isn't on the same column as 'class UserConfig(AppConfig). Tab appropriately. Hopefully, this helps someone. God Bless!

jaycel
Автор

Hands down the best teacher I've ever seen!, i wish we had more like you. Thank you for generously sharing you're knowledge 👏👏

dagmawigutu
Автор

thankyou Corey, great vid great work! btw, for those struggling on default picture, create a profile for your user (without adding picture), because you need to create profile for the user in order to add default picture to the profile.

StevenTse
Автор

Excellent Teacher! You make me to love the Django framework more and more! Keep the awesome work Corey. Simple I have to say thank you so

entertechinc
Автор

You're really amazing! Even after 1 year and I came back again to relearn and I am able to absorb everything smoothly from you! Thank you Corey!

remixowlz
Автор

Man, I love your videos. You are one a few BEST Teachers on this planet.

nicachipal
Автор

I think up to this far, my love for Django is as strong as the tutor....such amazing work. God bless you.

ABASSANIMERIKUKU
Автор

For those not getting a profile pic to load around the 25:30 mark, make sure you're putting the default.jpg into the project_name/media folder, and not in the folder. I didn't listen to Corey closely enough, but he mentions this specifically, although it seems minorly counterintuitive.

scphr
Автор

DEFINATELY THE BEST DJANGO TUT I've seen! thanks!

landolabrum