How to Upload Files to S3 Using Django Storages

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 84

  • @shah.md.mostakim
    @shah.md.mostakim Год назад

    After watching many other videos on this topic, finally, your video helped me at last to connect S3 bucket successfully. Thanks a lot. RESPECT 🌹

  • @williamliw5695
    @williamliw5695 2 года назад

    I've been at this for a little bit now and you gave the most straightforward but also most complete tutorial.
    I could kiss you right now

  • @FarhanAhmed1360
    @FarhanAhmed1360 3 года назад

    Thanks Man.. After searching lot of tutorial on internet at last I find your video and it worked

  • @sebastiancastillo3560
    @sebastiancastillo3560 3 года назад +1

    Greetings Antony, it is always very cool to see your tutorials.
    Thank you!

  • @MrBloodDoll
    @MrBloodDoll 3 года назад

    Thanks for this! The most concise tutorial out there. Worked for me immediately, unlike some others out there. Thank you!

  • @italopinto8614
    @italopinto8614 3 года назад

    I've been facing some issues with my django app and here I found the answer, thanksss! 🤩

  • @keithgetty2228
    @keithgetty2228 3 года назад

    I was stuck on this for a whole day. Thanks my friend. A like and a sub is not enough.

  • @jonathannzete6852
    @jonathannzete6852 2 года назад

    You are a life saver bro .
    simple and precise

  • @DmitriyMirgorodskiy
    @DmitriyMirgorodskiy Год назад

    Without any water. Thank you very much.

  • @O.nitin353
    @O.nitin353 3 года назад

    Hey bro, you are the lifesaver for me. I tried so hard to get this thing right but I couldn't. Thanks a lot.

  • @druashley
    @druashley 3 года назад

    Worked great. Instantly subscribed after this! Wonderful job!

  • @thescottypy
    @thescottypy 3 года назад +3

    Thanks for the video. Those are some really cute cats!

    • @prettyprinted
      @prettyprinted  3 года назад

      They are! I wish they were mine, but I just found some pictures online.

  • @Gilrohire
    @Gilrohire 3 года назад

    Such an excellent video, sad to see so few views and likes. Thank you man!

  • @amanbishnoi6894
    @amanbishnoi6894 3 года назад

    great video mate. found exactly what I came for.

  • @jasmeetpabla378
    @jasmeetpabla378 3 года назад

    Thanks for this video. It helped me to solve issue.

  • @gustavoadolfobautistagomez3855
    @gustavoadolfobautistagomez3855 2 года назад

    very good contribution thank you very much for sharing your knowledge.
    i have a question how can i delete a file from s3 aws with django?

  • @radomirmijovic2605
    @radomirmijovic2605 3 года назад

    Thanks man, very simple and clean !

  • @adrianperez7893
    @adrianperez7893 Год назад

    TE AMO WACHOOOOOOO, cortita y al pie, saludos desde Argentina jaja, aguante Santa Fe

  • @zahradeen3053
    @zahradeen3053 3 года назад

    Simple and precise....thanks for this

  • @guitardave77
    @guitardave77 3 года назад

    You helped me solve this issue! Thank you!

  • @rangabharath4253
    @rangabharath4253 3 года назад +1

    Awesome as always 👍😀

  • @MrAfroboy94
    @MrAfroboy94 Год назад

    Bro you are awesome, thank you so much, explain very well!!!

  • @sureshcstha
    @sureshcstha Год назад

    Thanks for the video! Could you please make a similar video but using supabase bucket?

  • @f4stfox637
    @f4stfox637 2 года назад

    thanks for the awesome tutorial. How to access to the files if the amazon server not public and I want to use files on my app?

  • @christ-like8830
    @christ-like8830 2 года назад

    thanks. saved hours of stress

  • @jvrosario
    @jvrosario 3 года назад +1

    After i iupload to s3 using react my drf is not immediately updating. I need to reload twice before the image updated. how can i solve this? Thank you

  • @sinancetinkaya
    @sinancetinkaya 3 года назад

    Excellent video Anthony 👍

  • @ecaIos
    @ecaIos 2 года назад +1

    Any advice on how to get it working on heroku? Getting a 500 error on the admin page only when I submit a file so I think that’s the issue. The only thing I changed was environment variables for the keys. It does work locally though. Any help would be appreciated

    • @irabor18
      @irabor18 2 года назад

      Same, have you been able to solve this issue?

  • @mkrtichhovhannisyan6244
    @mkrtichhovhannisyan6244 Год назад

    Thanks a lot. This was helpful.

  • @randheerkumargautam6433
    @randheerkumargautam6433 2 года назад +1

    how to do this with multiple file upload from admin panel by selecting all files in one go

  • @Mr-sq9ph
    @Mr-sq9ph 2 года назад

    Hi, i have one doubt
    You didn't declared anything regards S3 in Cat model, but how it was directly stored into S3 bucket?

  • @abdullahal-aboud6335
    @abdullahal-aboud6335 2 года назад

    you are amazing man

  • @JackHeidz
    @JackHeidz 3 года назад

    Congrats for video, I use AWS normaly in my application, but to upload files from forms it is not working correctly... file is not going to bucket...

  • @pc_analytics
    @pc_analytics Год назад

    Thank you! Very helpful

  • @charlestazerussell6725
    @charlestazerussell6725 3 года назад

    HOla. La imagen se guarda por duplicado, localmente y remotamente? o solo en AWS storage. Excelente video, gracias

  • @edgardelacruz8866
    @edgardelacruz8866 3 года назад

    Thank you very much friend, what do you recommend to keep my users' record icons safe? I noticed that you used the bucket public but I would like you to be more sure of my side

  • @larsulvaer
    @larsulvaer 2 года назад

    Thank you so much! It works!!

  • @conceptup3655
    @conceptup3655 Год назад

    That was great! Thanks so much.

  • @MrElectrecity
    @MrElectrecity 3 года назад +1

    Thank you thank you thank you
    I love it I love it I love it
    💖💖💖🥰🥰🥰

  • @segunisreal1723
    @segunisreal1723 2 года назад

    You saved me man!

  • @Amanda-qu9uw
    @Amanda-qu9uw 2 года назад

    Hi, thank you for this tutorial. Just wantes to ask, how can I use multiple buckets for different data needs? For example, pdfs to go in one bucket for one purpose and images to go in a different one.

  • @takibahmed8859
    @takibahmed8859 3 года назад

    Hello sir, thanks for the video already saved it for the future since I don't have a credit card at the moment, I was wondering if I added media_root in settings would there be any change? like a folder (named after the media_root) inside S3 bucket?

  • @HafizhL15
    @HafizhL15 3 года назад

    Thanks for the video. But How if using Google Cloud Storage in Django?
    Please make tutorial video about that.

  • @ensonev8768
    @ensonev8768 3 года назад

    Keep going bro

  • @رشاعشاوي
    @رشاعشاوي 2 года назад

    great it worked, thank you so much

  • @dimensionalilusions4520
    @dimensionalilusions4520 3 года назад

    Hi,there After the free tier limit, Amazon's gonna auto charge me can't i pause it or pay manually?

  • @wanyoikedanny472
    @wanyoikedanny472 2 года назад

    well explained,,thanks alot😍

  • @edchelstephens
    @edchelstephens 2 года назад

    How can I assign a policy that this certain user only has access to specific Buckets?

  • @saharamanson1970
    @saharamanson1970 2 года назад

    Awesome Video

  • @sarthakbhan1562
    @sarthakbhan1562 Год назад

    thanks for saving me

  • @Zobovibes
    @Zobovibes Год назад

    Awesome video. But how do we ensure each picture that goes into the s3 bucket has a different name ? AM thinking of importing random, os and string for this. Please, recommend me shorter method if possible.

    • @breadbreadbreader
      @breadbreadbreader Год назад

      For that, you can set AWS_S3_FILE_OVERWRITE to False in your settings file

  • @saujanmaka4476
    @saujanmaka4476 Год назад

    Does it also in work in digital ocean storage?

  • @dodokwak
    @dodokwak 3 года назад +1

    Thanks a lot, Anthony.
    I tried to go a little bit further and resize uploaded images with lambda function on amazon side.
    To do that I had to keep two buckets: one as a source bucket, second - for keeping re-sized images.
    Django can find the url that points to a resized image and it's almost OK.
    But I still struggling with 2 problems:
    1. When user uploads an image creating a new post we re-direct him often to a detail view.
    But image is not rendered at this point and in devtools there is an 404 (page not found)error for the image link.
    If detailed page is refreshed ( and so the second request for the same img is sent) the image is available as it should be.
    If user after upload gets redirected to a list view and then to the detail view, image is rendered without any problem.
    Seems it can't be an issue with perms, otherwise the img wouldn't be available at all.
    2. Second problem comes when user wants to delete an image.
    If it happens without implementing second bucket, django storage helps not only to delete a link(url) but also deletes the img file self.
    If I use flow with re-sizing, django storage seems not to know where the image to delete is. Although link to the image gets removed, I'm afraid that I'll get too many orphan images at some point.
    Feedback is more then welcome.

    • @prettyprinted
      @prettyprinted  3 года назад

      For the first issue, the only thing I can think of is your page loads your detail view faster than the image gets resized and moved on S3. If that's the case, then I'd have some async JavaScript process waiting to load the image on the detail page if it's important for the user to see right away.
      For the second, I guess it depends on how you got the image resizing to work. If you extended the storage class directly, then you'll to update the delete method for S3Boto3Storage. If you did something like just crafting the URLs directly using the bucket for the resized images, then updating the delete method should also work.

    • @dodokwak
      @dodokwak 3 года назад

      @@prettyprinted Thank you very much. Very helpful.

  • @alefegomes6770
    @alefegomes6770 2 года назад

    How do I do it if I want to display let's say this cat3 image in an application
    How would it be called in the template?

  • @dmbrv
    @dmbrv 3 года назад

    Nice video. Can you make a video about Flask 2.0 and the new async views they added. Thanks

  • @M-ABDULLAH-AZIZ
    @M-ABDULLAH-AZIZ Год назад

    what if i want my admin user to be able to view pictures any user has submitted like pictures for verification of identification documents?

  • @motlatsimoea5615
    @motlatsimoea5615 3 года назад

    Does anyone know why I get a message telling that I do not have permission the edit bucket policy and how to fix that?

  • @edchelstephens
    @edchelstephens 2 года назад

    Thanks a lot!

  • @yilmazbingol4838
    @yilmazbingol4838 3 года назад

    how to write an endpoint to store the file in s3 and return the url to frontned?

  • @akhilsharma392
    @akhilsharma392 6 месяцев назад

    I am getting an error can't see the admin dashboard after login it shows error like can't force an update in save() with no primary key

  • @libinluvis4223
    @libinluvis4223 3 года назад

    H13 - Connection closed without response
    This error is thrown when a process in your web dyno accepts a connection but then closes the socket without writing anything to it.
    While Uploading Some files it Causing this Error ??

  • @parthokr
    @parthokr 2 года назад

    Can you make a video on azure blob storage?

  • @franciscojavierfrancobelen2691

    Thanks a lot :)

  • @byronjce1
    @byronjce1 3 года назад

    thank you

  • @pil_low
    @pil_low 3 года назад

    Please help: Unable to import 'storages.backends.s3boto3' pylint(import-error)

    • @pil_low
      @pil_low 3 года назад

      Both django-storages and boto3 installed, but while using
      DEFAULT_FILE_STORAGE= 'storages.backends.s3boto3.S3Boto3Storage'
      I get message "Endpoint request timed out",
      when I try to make a custom storage, I get the above import-error.

  • @GabyReyesRomero
    @GabyReyesRomero 3 года назад

    Thank you!!!

  • @codedjango
    @codedjango 3 года назад +1

    Nice..

  • @6923973
    @6923973 3 года назад

    So does the file still hit the django server or does it get handed off to s3 via the client?

    • @prettyprinted
      @prettyprinted  3 года назад

      The Django server will move the file to S3, but it never gets saved on the same server as your Django app.

    • @6923973
      @6923973 3 года назад

      @@prettyprinted i guess what im asking is, is this method of uploading files as scalable as uploading files directly to s3 using presigned urls from the client?

  • @tomaszscierski7351
    @tomaszscierski7351 2 года назад

    Thanks a lot!

  • @berk_karaal
    @berk_karaal 2 года назад

    Thank you