File Upload Dropzone

Hi Django community!
I am currently implenting a file upload on my website and wanted to add a drag and drop zone but I couldn’t find any insturctions on how to build that incombination with django. My frontend is built using bootstrap and I already tried some implementations from the internet but none of them work how I hoped they would.
Can anyone provide me some help? I am pretty new to website programming.

It might be helpful if you provide a little more detail as to how you’re trying to do this - specifically, what libraries are you using for the client-side javascript and how you’re trying to accept the submission on the Django side. Also, it might be helpful if you explain what you mean by “none of them work how I hoped they would” - what is it that you’re trying to do, and how does the implementation you’re using differ from that?

Most of this work is going to be on the client side. For how you need to handle it on the Django side, see the documentation at: https://docs.djangoproject.com/en/3.0/topics/http/file-uploads/

The Django side I already sorted out and tested it using the generic generated form which worked without any problems. On the client side I tried using Dropzone.js but as of right now I haven’t got it to work probably. It just created a grey box around my form and didn’t add any drag and drop features. I also tried some tutorials on how to implement Dropzone.js with Django but they were all 4-5 years old and didn’t work for me.

Ok, you’re now outside my realm of experiences. If I was working on this problem, my first step would be to get Dropzone working in a static page that isn’t managed by Django. (You could test it by still having that page post to Django if you need a target endpoint.) But from your description, my first impression is that there’s something not quite set up right on the javascript side that could be resolved independently from Django.