Deleting Uploaded Files - Django File Upload Tutorial - Part 4

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • In this tutorial you are going to learn how to handle deletion of uploaded files.
    👉 Django File Upload Playlist: • Introduction - Django ...
    -------------------------------------------------------------------------------
    (0:25) How uploaded files are handled by Django
    (1:28) Creating the delete_book view function
    (3:21) Adding the delete button on the template
    (5:48) Overriding model delete method
    (7:30) A word on how to handle batch delete
    -------------------------------------------------------------------------------
    📎 Download the mindmap with references I used in the video: sibt.co/2OB5peg
    ✍🏻 Read the blog post: sibt.co/2OF6PUU
    👨🏻‍💻 Project source code: github.com/sib...
    ✉️ Let's keep in touch! Subscribe to my mailing list: sibt.co/newsle...
    🌎 For more on Django, Python and Web Development: simpleisbetter...
    -------------------------------------------------------------------------------
    🧔🏻 Follow me on:
    github.com/vit...
    / vitorfs
    / vitorfs
    / vitorfs
    #django #python

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

  • @shadanahmad6843
    @shadanahmad6843 5 лет назад +20

    This is most comprehensive tutorial on the internet about file upload in django. Please keep it coming for other components.

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

    2022 and still one of the best tutorials on this subject. Thank you!

  • @cyrilmmojekwu9331
    @cyrilmmojekwu9331 4 года назад +1

    You're a life saver in django ! 😘😘😘.
    Please keep it up by adding more. I'd keep recommending others to your channel.

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

    Amazing! Amazing how easy it is to delete files, but I see many tutorials making this process difficult, using signals, but it's not necessary.

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

    Tremendous help with this series! thank you so much

  • @AnkitKumar-ow6fg
    @AnkitKumar-ow6fg 4 года назад

    Thank you so much for creating this. I have been scratching my head for weeks now. This is the solution i needed.

  • @Mr.Existence
    @Mr.Existence 5 лет назад +6

    Love it, here's an easy copy-paste title for your next video

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

    great sir ,ur blogs are highly knowledgable ,and I come across this channel through ur website and subscribed it also,thanks a lot

  • @CoinPickerUS
    @CoinPickerUS 4 года назад

    Oi Vitor! I wanted to thank you hugely for taking the time to code and share the multiple choice example for Django. I have retyped all the code to learn how to implement this useful approach to forms. No one else on the web that I could find had a better example than you. If you are looking for an exciting Django/Python/AI project to work on, I have one and need a coding partner smarter than me, as you are.

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

    Thank you! Exactly what I was looking for

  • @joecook372
    @joecook372 4 года назад

    Thank you for taking the time to create these videos. Learned A lot. Great explanations.

  • @fasihuddin2620
    @fasihuddin2620 4 года назад

    Thanks man great work you save my life.

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

    The best tutorial ever. Thank you, Vitor!

  • @prabinraee6749
    @prabinraee6749 4 года назад

    thank u man for this django series.
    helped me a lot in my project

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

    Very very very helpful videos. Thank you Vitor. )

  • @leeroyviljoen6023
    @leeroyviljoen6023 4 года назад

    BRILLIANT!

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

    You are the best! Thank you!!

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

    Great!! Brazilians thank.

  • @EddyCaffrey
    @EddyCaffrey 5 лет назад +1

    Great video, great explanation, great topic. 👍

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

    i have a question i have to delete multiple file django using a button of delete all i am able to delete object but can't delete all corresponding files in it

  • @ati43888
    @ati43888 5 лет назад +1

    Tanks for this totorial Vitor. Please, AbstractBaseUser and LDAP authentication totorial..

  • @ionutenasoae6034
    @ionutenasoae6034 4 года назад

    Thank you for the very good tutorial Vitor!

  • @isard777
    @isard777 5 лет назад

    Thank you very much! I finally understand some details that I never understand before :-).
    If you have any other Django tutorial, I'm going watch it without any hesitation.

  • @jmpersic
    @jmpersic 5 лет назад

    Hey Vitor, thanks the helpful advice and tutorials on your blog! Just discovered your channel and subscribed! Your django tutorials are excellent and very appreciated.

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

    thanks so much, it's work i have tried on my code.

  • @nathanwise6973
    @nathanwise6973 4 года назад

    Thank you for the video. After reading up and then watching your video. I was easily able to implement the ImageField into my project with little to know issues.
    Your tactic of showing us the long hand code before the model Django "Magic" really helps.
    I would like to request a video like this about how to save many images to one Book.

  • @jerasiva
    @jerasiva 5 лет назад +3

    You could do a Django registration with confirmation email tutorial, with version of django 2.2

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

    Crystal clear, thanks a ton man :)

  • @emanuelgabriel2597
    @emanuelgabriel2597 5 лет назад +1

    Yuor job is great!
    congratulations Vitor.

  • @egitaufiqnoor3612
    @egitaufiqnoor3612 4 года назад

    hai vitor , please continue the django series please
    it helps a lot of newbie who learn django like me.

  • @shahidullahmiazi
    @shahidullahmiazi 5 лет назад +1

    Everything Amazing! Thanks Sir.

  • @GustavodeAndrade
    @GustavodeAndrade 4 года назад

    Obrigado, Vitor!
    Dica preciosa e precisa!

  • @luisenriquebeltrangonzalez8602
    @luisenriquebeltrangonzalez8602 5 лет назад

    You are awesome! thank you by share your knowledge

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

    Muito obrigado... Asante sana

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

    you are good person, mate
    you are awesome

  • @TravelUnplugged
    @TravelUnplugged 5 лет назад +1

    hello thank you for your tutorial

  • @muhammaddilshadkhaliq540
    @muhammaddilshadkhaliq540 5 лет назад +1

    Sir thanks,
    please upload video series for extending user model in django with all possible way.

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

    thankyou brother

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

    Hi Sir !
    Now using ModelForm how can I update a new image to an object after I delete its old image at once ?
    I mean delete the old image from the disk and replace it but the once ?

  • @sumitnagar7172
    @sumitnagar7172 5 лет назад

    Thank you sir.. You are awesome 👍

  • @djrenders
    @djrenders 5 лет назад

    nice video, I follow your website quite often..It's great too !!

  • @aakashkumar-pc7xo
    @aakashkumar-pc7xo 5 лет назад +1

    i uploaded files using date then i dont know how to get files between two dates

    • @Saradomin65
      @Saradomin65 4 года назад

      Use filter where date >= startDate and date

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

    How would this be done when updating, for example, I update the image that the post is linked to, how would i delete the image that isn't in use anymore?

  • @user-hr2zy3sl3x
    @user-hr2zy3sl3x 4 месяца назад

    thanks

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

    The object as well as image is deleted when you delete from the localhost:8000/books but if you try to delete from admin panel i.e. localhost:8000/admin/books/book and check/tick the object you want to delete and select the action button that shows dropdown list and select 'Delete selected books' then the object is deleted but not the image associated with it. How can i fix it ?
    [Edited]
    Both the object and image is deleted if we delete as '127.0.0.1:8000/admin/books/book/1/change/' but only object is deleted if we delete from '127.0.0.1:8000/admin/books/book/'. Why is it so and how can i fix it ?

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

    Muito obrigado pelo tutorial, me salvou aqui! Parabéns e continue postando pois você é muito claro e objetivo! ;-)

  • @priyank1873
    @priyank1873 5 лет назад

    Amazing tutorial...
    I recently checked out your new series a complete beginner guide to Django part 1... It's amazing...

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

    Hi Vitor, Thank you much for the videos. Can you also show how to delete using CBV? Thanks in advance

  • @mitch8204
    @mitch8204 4 года назад

    Would `{file-filed}.delete(save=True)` be a better approach?

  • @altertig1032
    @altertig1032 4 года назад

    Thank you for the video and the science, but for the delete action I have a problem, when delete is clicked, there is no deletion, after I have followed the correct code, I use django 1.11.

  • @RAVI-nw3kd
    @RAVI-nw3kd 3 года назад

    Sir, how can we add data deduplication removal using file checksum in Django. Kindly guide the path...

  • @NiyantaVlogs
    @NiyantaVlogs 5 лет назад

    Hello,
    I want that the uploaded files can be deleted only by the superuser not by the users. How can I do this?

  • @Kamran_Sadikhov
    @Kamran_Sadikhov 4 года назад

    Hi, super tutorial.. can you also explain how users can share books between and comment them?

  • @jonathanwarner2420
    @jonathanwarner2420 5 лет назад

    Great job, mate! May be you can make a playlist of: forms, formset and inline forms and how to setup them especially when using many-to-one and many-to-many relations. I can't find good form-tutorials out there.

  • @alaskanadventures8124
    @alaskanadventures8124 5 лет назад

    Beautiful! Any chance to have a #5 video on how to protect uploaded files when they are served by Apache?

  • @JGPARAM
    @JGPARAM 5 лет назад

    @vitor your video really helped me a lot. I am making a web app using django. In that app, I have use google auth for login. I only want that only allowed users can log in. But google auth login, open up a new account(like sign up). how to stop it.

  • @akindelelekan614
    @akindelelekan614 5 лет назад

    Comprehensive tutorial, can you do a tutorial on view count?

  • @youngomer1416
    @youngomer1416 4 года назад

    First of all I would like to think you you for this amazing series...
    And I also have a question.
    I would like to know if there is a way of having a download count to our pdf download.
    Sorry for my poor english

  • @varshikagurudu4306
    @varshikagurudu4306 5 лет назад

    Woww such a good video sir..please make videos on JSON

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

    Anyone else having a problem with deleting a file? no error shows up but the file remains there and is still displayed on the view

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

    thanks, Vitor :_:

  • @Skaxarrat
    @Skaxarrat 5 лет назад

    I like to do multi-video tutorials on one go instead of spacing over few days, so I have to ask: Is this the final video of 'Django File Upload' tutorial?

    • @vitorfs
      @vitorfs  5 лет назад +1

      There will be a last video following up a few points people asked for :D

    • @Skaxarrat
      @Skaxarrat 5 лет назад +1

      @@vitorfs Thanks Vitor, I love your tutorials and your blog. You helped me a lot (specially with Ajax calls!)

  • @ramaisgod
    @ramaisgod 5 лет назад

    Nice tutorial bro..
    Can you help me in Python Django? I am developing Employee Leave Management system. Plz reply..

  • @thomassaied1710
    @thomassaied1710 5 лет назад

    how u did download file ???

  • @azizihussain2866
    @azizihussain2866 5 лет назад

    how to do multiple file upload

  • @mark2rex
    @mark2rex 5 лет назад

    your videos are excellent :D
    So in your article you used from uploads.core.models and for some reason it says "unable to import uploads.core" in mine :(
    please help if possible

    • @vitorfs
      @vitorfs  5 лет назад

      In the article "uploads" was the name of my Django project, and "core" was the name of the app. "Document" was the name of the Django Model I created inside the app named "core". So basically you need to rename "uploads" and "core" to the name of your Django project and the name of the app where you are creating your model

  • @marscode3615
    @marscode3615 5 лет назад

    sir can u help me tutorial about foreign key user upload?

    • @marscode3615
      @marscode3615 5 лет назад

      every user can upload and the user can only view what they upload and not others