How to Upload Files to S3 Using Django Storages

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 84

  • @speak.thetruth5017
    @speak.thetruth5017 11 місяців тому

    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

  • @italopinto8614
    @italopinto8614 3 роки тому

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

  • @sebastiancastillo3560
    @sebastiancastillo3560 3 роки тому +1

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

  • @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.

  • @MrBloodDoll
    @MrBloodDoll 3 роки тому

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

  • @user-td3fo2zm7o
    @user-td3fo2zm7o Рік тому

    Without any water. Thank you very much.

  • @keithgetty2228
    @keithgetty2228 2 роки тому

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

  • @adrianperez7893
    @adrianperez7893 10 місяців тому

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

  • @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.

  • @druashley
    @druashley 3 роки тому

    Worked great. Instantly subscribed after this! Wonderful job!

  • @jonathannzete6852
    @jonathannzete6852 2 роки тому

    You are a life saver bro .
    simple and precise

  • @MrAfroboy94
    @MrAfroboy94 9 місяців тому

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

  • @Gilrohire
    @Gilrohire 3 роки тому

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

  • @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?

  • @jasmeetpabla378
    @jasmeetpabla378 3 роки тому

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

  • @jvrosario
    @jvrosario 2 роки тому +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

  • @randheerkumargautam6433
    @randheerkumargautam6433 2 роки тому +1

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

  • @amanbishnoi6894
    @amanbishnoi6894 3 роки тому

    great video mate. found exactly what I came for.

  • @sureshcstha
    @sureshcstha Рік тому

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

  • @akhilsharma392
    @akhilsharma392 3 місяці тому

    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

  • @zahradeen3053
    @zahradeen3053 2 роки тому

    Simple and precise....thanks for this

  • @edchelstephens
    @edchelstephens 2 роки тому

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

  • @radomirmijovic2605
    @radomirmijovic2605 3 роки тому

    Thanks man, very simple and clean !

  • @christ-like8830
    @christ-like8830 2 роки тому

    thanks. saved hours of stress

  • @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?

  • @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?

  • @mkrtichhovhannisyan6244
    @mkrtichhovhannisyan6244 Рік тому

    Thanks a lot. This was helpful.

  • @guitardave77
    @guitardave77 3 роки тому

    You helped me solve this issue! Thank you!

  • @pc_analytics
    @pc_analytics Рік тому

    Thank you! 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?

  • @rangabharath4253
    @rangabharath4253 3 роки тому +1

    Awesome as always 👍😀

  • @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?

  • @sinancetinkaya
    @sinancetinkaya 3 роки тому

    Excellent video Anthony 👍

  • @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

  • @conceptup3655
    @conceptup3655 Рік тому

    That was great! Thanks so much.

  • @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.

  • @abdullahal-aboud6335
    @abdullahal-aboud6335 Рік тому

    you are amazing man

  • @gustavoadolfobautistagomez3855

    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?

  • @larsulvaer
    @larsulvaer Рік тому

    Thank you so much! It works!!

  • @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...

  • @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?

  • @MrElectrecity
    @MrElectrecity 3 роки тому +1

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

  • @dimensionalilusions4520
    @dimensionalilusions4520 3 роки тому

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

  • @رشاعشاوي
    @رشاعشاوي 2 роки тому

    great it worked, thank you so much

  • @segunisreal1723
    @segunisreal1723 2 роки тому

    You saved me man!

  • @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 ??

  • @charlestazerussell6725
    @charlestazerussell6725 2 роки тому

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

  • @saujanmaka4476
    @saujanmaka4476 11 місяців тому

    Does it also in work in digital ocean storage?

  • @wanyoikedanny472
    @wanyoikedanny472 2 роки тому

    well explained,,thanks alot😍

  • @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.

  • @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?

  • @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

  • @yilmazbingol4838
    @yilmazbingol4838 2 роки тому

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

  • @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.

  • @saharamanson1970
    @saharamanson1970 2 роки тому

    Awesome Video

  • @HafizhL15
    @HafizhL15 3 роки тому

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

  • @sarthakbhan1562
    @sarthakbhan1562 10 місяців тому

    thanks for saving me

  • @tomaszscierski7351
    @tomaszscierski7351 2 роки тому

    Thanks a lot!

  • @dmbrv
    @dmbrv 3 роки тому

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

  • @parthokr
    @parthokr 2 роки тому

    Can you make a video on azure blob storage?

  • @berk_karaal
    @berk_karaal 2 роки тому

    Thank you

  • @franciscojavierfrancobelen2691

    Thanks a lot :)

  • @ensonev8768
    @ensonev8768 3 роки тому

    Keep going bro

  • @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?

  • @codedjango
    @codedjango 3 роки тому +1

    Nice..

  • @GabyReyesRomero
    @GabyReyesRomero 3 роки тому

    Thank you!!!

  • @edchelstephens
    @edchelstephens 2 роки тому

    Thanks a lot!

  • @byronjce1
    @byronjce1 2 роки тому

    thank you