▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My RUclips Channel: bit.ly/35Xo9jD 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/3sJpeV6
i was soooooooo stuck at the image uploading thing but thanks to your video i understood it as well as i resolved the issue .....thanks man ... love from pakistan
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.
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
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.
I know it's not realted with your schedule, but, I found this new thing HTMX really usefull in django, will you explaine it maybe in future? It's soo good to know that we can focus on django and html only
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?
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!
Would you recommend me to read a book : (building android apps in python using kivy with android studio with pyjnius plyer and buildozer) or just take a kivy course
how to insert images directly to database in blob data type, and when delete the data in database in admin site the image is not deleted in media/images folder , how to fix?
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.
did you load the static in the template prior to this video? because, I can't seem to display the image in the template. Advance thanks for the response. Great tutorial BTW.
Hi there. Would there be a reason why MEDIA_URL or MEDIA_ROOT wouldn't show up right after I typed settings. ? I've been trying to figure out this problem for a while now. Any help would be appreciated!
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
Love your videos. Could you make a video for the following? Is there a way with Django to upload multiple PDF files at once from the webpage via a form, convert them into an image format (PNG, JPEG, etc.), then save only the images to the media directory and only the images URLs to a "image" Model then delete the PDF versions of all the files all together?
I'm a little confused about something (also after looking at the official documentation). The images are working in html...but only when I set debug = True in the settings py script. When I set debug = False, the images from ImageField are all dead. I don't know what to do, I tried the csrf_exempt decorator but it didn't change anything. Is this normal? I wish the documentation would explain more.
Hi! I followed your steps but I still can't view the image that I uploaded. I receive this whenever I click the image file "The requested resource was not found on this server."
I made a django-cookiecutter docker project where users can upload an avatar but when I put it on a digital oceans Ubuntu server the edit form saves image path and not the image itself to the media folder. It causes a 500 error for file not found and breaks every page where the file is referenced. Anyone have any advice?
Hey did everything you said but still the image doesn't upload. It uploads but doesn't show either in the website nor the media file is created automatically Also creating manually doesn't work the media file Pls can I have a fast reply
@@austinematurure1512 I made it, but not as cautiously as I wanted ---- I decided make uploading image an adding it to some list of images... If you'll find a better option -- let me know :)
sir when i upload big files it takes time. can you make a video to upload large files to s3 using celery or something like that so that the user need not wait.
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.
How to deal with this ? WARNINGS: ?: (staticfiles.W004) The directory 'C:\Users\HP\PythonProjects\django\src\static' in the STATICFILES_DIRS setting does not exist.
I am using Django 4.14. In the settings.py file, I commented out the STATICFILES_DIRS line and this same migration error went away and I was able to finish this lesson without a problem. Apparently this line is not needed?
Oh, is the 14 minute free video that teaches you exactly what you need not fast enough for you? I have no patience for that sort of whiny entitlement. Go watch someone else's videos.
Thanks but I need help, when I run the makemigrations I have this error: File "/code/docker_django/unidepApp/urls.py", line 14, in ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) File "/usr/local/lib/python3.7/site-packages/django/conf/urls/static.py", line 22, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/35Xo9jD 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/3sJpeV6
It was so pleasing to learn Django Images from the greatest cook Heisenberg himself. Thanks!
HA!
i was soooooooo stuck at the image uploading thing but thanks to your video i understood it as well as i resolved the issue .....thanks man ... love from pakistan
Happy to hear it!
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.
Happy to hear it
You saved my day, man. Thanks a lot!
Happy to hear it!
Me too. Saved my contract
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
Glad you got it sorted out!
Your BIG FAN
Thanks!
Thank you. I was searching a simple example like this, about a field image in Django. Thanks!
Welcome!
All these steps just to upload an image huh! Django really is Flask on double steroids. Thank you for sharing :)
sure
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?
Thank you! I've spent so long looking for a solution to this
Happy to help!
Thanks bro, you're the best teacher
Welcome!
thanks a lot sir!!
thanks a lot mr.white
lol welcome
Nice! I really love Django😍
Glad to hear it!
Thank you so much bro, you saved my life :)
Happy to hear it!
you are a great professor
Thanks!
very good video. i dont speak english but I understand very much!!! 😀👍👍 very helpful
Happy to hear it!
WOAH IT WORKED
THANKS (A LOT)
glad to hear it
Finally!!! A solution! Thanks Jhon!!!
Sure thing!
clear and useful, thanks a lot
Happy to help!
thanks, this helps me in my learning journery xd
Happy to hear it!
thank you for this
Welcome!
thank you so much, bro
Welcome!
Muito obrigado
AVANTI PALESTRA!!!
Welcome!
thanks man. best tutorial!
Welcome!
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.
Thank you
Welcome
Perfect!!! Tanks man!
Welcome!
thank !!! it was really helpful for me
Happy to hear it!
Good one
Thanks!
You just earned a sub
Thanks!
nice video, saved my life
Happy to hear it!
Very nice video. Thank you! 👍🏿
Thank you too
شكرا thanks
welcome
thank you man!
Welcome!
Amazing tutorial sir, you saved my life, and can I use this method in production
of course
I know it's not realted with your schedule, but, I found this new thing HTMX really usefull in django, will you explaine it maybe in future? It's soo good to know that we can focus on django and html only
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?
thanks
welcome
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?
is there a way to upload the same image to two different models.ImageFields? one for header_image and one for thumbnail?
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!
OMG thank you
Welcome!
Would you recommend me to read a book : (building android apps in python using kivy with android studio with pyjnius plyer and buildozer)
or just take a kivy course
Do whatever you like :-p or both
how to insert images directly to database in blob data type, and when delete the data in database in admin site the image is not deleted in media/images folder , how to fix?
Most hosting providers don't allow that anymore. You have to upload your images to a cdn and reference the URL in your database
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.
When I add the url, the error "attribute has no file associated with it". Appears
I wonder how can we setup media configuration with pathlib
did you load the static in the template prior to this video? because, I can't seem to display the image in the template. Advance thanks for the response. Great tutorial BTW.
Possibly, I don't remember...go watch and see.
Thanks once again i struggled to deal with media
welcome
Hi there. Would there be a reason why MEDIA_URL or MEDIA_ROOT wouldn't show up right after I typed settings. ? I've been trying to figure out this problem for a while now. Any help would be appreciated!
They'll only show up after the first time someone uploads an image. It's the uploading of the image that triggers the creation of the directory.
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
Sorry, that's not possible or related in anyway to this video...
Thank you so much for your quick response. Best wishes
will this work on Heroku or my statics file will be deleted.
Love your videos. Could you make a video for the following? Is there a way with Django to upload multiple PDF files at once from the webpage via a form, convert them into an image format (PNG, JPEG, etc.), then save only the images to the media directory and only the images URLs to a "image" Model then delete the PDF versions of all the files all together?
There's no default mechanism in Django to do that, you'd have to do quite a bit of hacking to get that done.
@@Codemycom what about just how to upload multiple files/images at once?
I'm a little confused about something (also after looking at the official documentation). The images are working in html...but only when I set debug = True in the settings py script. When I set debug = False, the images from ImageField are all dead. I don't know what to do, I tried the csrf_exempt decorator but it didn't change anything. Is this normal? I wish the documentation would explain more.
Hey! Im having the same issue. Any idea on a fix?
How to upload Videos?? Pleasee can someone tell
Hi! I followed your steps but I still can't view the image that I uploaded. I receive this whenever I click the image file "The requested resource was not found on this server."
You'll have to rewatch the video and try to figure out what you missed.
Sir, we are missing your two video. Those are hidded I beleive...39 & 40. Are we elligible for those two?
We haven't gotten that far. This is the latest video, they come out every Wednesday
I made a django-cookiecutter docker project where users can upload an avatar but when I put it on a digital oceans Ubuntu server the edit form saves image path and not the image itself to the media folder. It causes a 500 error for file not found and breaks every page where the file is referenced. Anyone have any advice?
Hosting services usually don't let you upload images to a database. You need to use a cdn.
Hey did everything you said but still the image doesn't upload. It uploads but doesn't show either in the website nor the media file is created automatically
Also creating manually doesn't work the media file
Pls can I have a fast reply
Then no, you didn't do everything I said. Try rewatching the video again and try to catch what you missed the first time.
@@Codemycom yeah got it wrong config of db
Thank you! Is it possible to upload many pictures and then show all of them?
Sure, but I don't have any videos on that.
Hi did you figure out how to do this? I need help
@@austinematurure1512 I made it, but not as cautiously as I wanted ---- I decided make uploading image an adding it to some list of images... If you'll find a better option -- let me know :)
@@user-yf4vl2rp8u I found a way but you'll have to upload the images one by one
4.0 django error time zone not found please solve this problem
That's not what this video is about, we're not using 4.0 here
sir when i upload big files it takes time. can you make a video to upload large files to s3 using celery or something like that so that the user need not wait.
Upload speeds depend on the users internet connection. Not on S3 etc.
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.
hey jhon 3rd like 🤩
Nice!
How to deal with this ?
WARNINGS:
?: (staticfiles.W004) The directory 'C:\Users\HP\PythonProjects\django\src\static' in the STATICFILES_DIRS setting does not exist.
It's telling you that the directory doesn't exist. You've made an error in your code. what is src? Why is it looking for that?
I am using Django 4.14. In the settings.py file, I commented out the STATICFILES_DIRS line and this same migration error went away and I was able to finish this lesson without a problem. Apparently this line is not needed?
This is on the development environment only. You can't upload images on production like that.
Sure you can
@@Codemycom I tried it with DEBUG = False, and suddenly it cant access images
I am currently experiencing same issue, I cant upload or view the images after I change debug to false. Please can you guide me on how you fixed this
Jesse... We need to code...
lol
Man, thank u but please get to the point directly
Oh, is the 14 minute free video that teaches you exactly what you need not fast enough for you? I have no patience for that sort of whiny entitlement. Go watch someone else's videos.
Thanks but I need help, when I run the makemigrations I have this error:
File "/code/docker_django/unidepApp/urls.py", line 14, in
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
File "/usr/local/lib/python3.7/site-packages/django/conf/urls/static.py", line 22, in static
raise ImproperlyConfigured("Empty static prefix not permitted")
django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted