How to Upload an Image Using Django ImageField (The RIGHT Way)

preview_player
Показать описание

Timestamps:
00:00 - Introduction
08:03 - Add a file
09:17 - Display id in admin page
09:53 - Movie detail page
15:22 - Display movie in HTML
16:13 - Configuration garbage

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853

#python #django #webdevelopment
Рекомендации по теме
Комментарии
Автор


Timestamps:
00:00 - Introduction
08:03 - Add a file
09:17 - Display id in admin page
09:53 - Movie detail page
15:22 - Display movie in HTML
16:13 - Configuration garbage

codebreakthrough
Автор

The only place where I found answer how to make it :) Thanks a lot!

Marcin-mblg
Автор


This is exactly what i needed.. God Bless You.

praisecodes
Автор

Thank you So Much for this Video. You are a lifesaver.

chawaphiri
Автор

Thank You veru much!!!!
You realy help me to do this on my own

somorgin
Автор

Thank you for the video. May I know what VSCode extension are you using that prompt you with the Django imports tool tips?

arun.sekher
Автор

I do have custom user model with profile-image field. In my form_valid method I have this user.save(commit=False) to save other extra fields. The problem I'm having is I can't save the image under a directory with the profile_image/user.pk as the folder name for the instance is not yet saved and the folder made is profile_image/None instead of the user.pk. Can you give me a workaround on this other than using UUID? I was thinking of using signals but I can't pull it off.

xtiandyc
Автор

Hey Caleb thank you so much for the video! I am having a small problem on my end. When I determine the path of the files in the upload_to arg it doesn't save into the stores files unless i specifically say stores/images but when I do that the GET looks in stores/stores/images
I could just move the file over after it uploads to the file outside of the stores files but Im just curious what I am doing wrong.

ThisIsBander
Автор

Eres el mejor, enserio me ayudaste con algo que me tenía horas ocupado, gracias

alexanderseydewitz
Автор

hi, I have a question please
I want to share an image from my laptop to tablet (without touching in the tablet).
if I changed the image on my laptop it must change in the tbalet.
thanks in advance

mohammedbakkari
Автор

Direct! You jus got i New subscrever. Greatings from Brazil my man! The way i speak this is my country is "salve! meu amigo"

thaleshenriquesantosdasilv
Автор

Great tutorial! Thank you!
p.s. could you show the same uploading image functionality, but to get an image from outer URL (from internet)? or maybe just give me an idea..

ruslanways
Автор

Oh man, that was so clear and simple. Imgs were always a bit confusing for me when it comes to Django. I'm definitely donating some $ once I'm not broke :D

dragoondigital
Автор

When I select choose file in the django admin to upload the image nothing happens 😟😟😟 I’ve been stuck here for hours, can’t find the error

anon....
Автор

how to set default image to image field and show it in urls ?, like showing media files in urls

ashokkmr
Автор

Bro can u also do video of capturing a image(through laptop camera) and storing it Django please

poornachanduchalla
Автор

Hi,
How is it to make ImageField() as optional where user is given the option to Upload or NOT to upload the image. I have been having problem to do just that on Django DRF APIView.

rgsma
Автор

error: type object Movie has no attribute object

AttributeError
Please help

hrishikeshsonawane
Автор

From freecodecamp (database design course)

nostranostra
Автор

IMPORTANT!! DO NOT USE THIS IN PRODUCTION. THIS IS UNSAFE.

People can view your whole code.

Great for debugging. But NOT for production. This is NOT the "correct" way.

AmirIskandar