Upload Images To Django - Django Wednesdays #38

preview_player
Показать описание
In this video I'll show you how add the ability for users to upload images to your Django App.

Uploading images to Django is a bit convoluted. But we'll add images to our venues in this video and it's not too bad!

#django #codemy #JohnElder

Timecodes

0:00​​ - Introduction
3:40 - Add StaticFiles_Dirs
5:40 - Add Image Field To Model
7:08 - Make and Push Migration
8:20 - Add Multipart Form-Data Encoding To Form
13:08 - Create Image Tag
13:33 - Conclusion
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

It was so pleasing to learn Django Images from the greatest cook Heisenberg himself. Thanks!

kutayyildirim
Автор

man your video saved me
after like 3 hours searching on stakeoverflow your tutorial helped with the idea of linking the image to the user with getting the "venue =save(commit=False)" and then assigning to venue.user
thank you sir

erenyeager
Автор

This really saved me. I had already lost 5+ hours fixing the issue of non displaying images saying url link not available. Watching this video helped me resolve my issue. Thank you.

edappalkkaran
Автор

Thank you. I was searching a simple example like this, about a field image in Django. Thanks!

crcacom
Автор

i was stuck at the image uploading thing but thanks to your video i understood it as well as i resolved the issue man ... love from pakistan

lone_wolf
Автор

How can we to limit the size of the attached file/image in django? I mean as example not more than 3MB or something like this?

oqnpudq
Автор

Amazing set of videos.... Well done... Congrats....
Could you please also put a video on how we can upload a file or image with time stamp field in DB?
I mean a case in which user only needs to insert image but the application also stores the upload time as well in db.

babaksolhjoo
Автор

Thank you! I've spent so long looking for a solution to this

Dante-nucn
Автор

Hello John.
I hope you are well.

How different is uploading a file from this example?
Its just change the ImageField to a FileField ?

Thank you, once again!

eduardocardoso
Автор

i mean when i upload one file it went to django server. then from there it went to s3. and in this last step it takes a long time to get response that your file is uploaded. so i was thinking if we use celery we don't need to wait further to upload to s3 to get response. it will automatically upload the file in background to s3 after we upload it from user end.

shankar
Автор

Thanks bro, you're the best teacher

nazariyholovach
Автор

the image doesn't reflect in the db even though there are no typo, the multipart is correctly spelled. what you think is the problem?

justpi
Автор

Thank you so much bro, you saved my life :)

DarkCloud
Автор

very good video. i dont speak english but I understand very much!!! 😀👍👍 very helpful

fluke_
Автор

Thanks for the great video. I'm badly stuck though. Suppose I serve large files like gigabytes in size. I have a download server which allows only FTP file uploads. How can I configure my django application to upload media files to the other server (which is located on another machine) and then serve files from there?

napo
Автор

I wonder how can we setup media configuration with pathlib

code-snippets
Автор

When I add the url, the error "attribute has no file associated with it". Appears

amirhossein
Автор

is there a way to upload the same image to two different models.ImageFields? one for header_image and one for thumbnail?

hkspiderfret
Автор

thank !!! it was really helpful for me

alejandrokroma