Questions tagged [django-file-upload]

Django-file-upload refers to how django handles file uploads

Django-file-upload refers to how django handles file uploads.

See documentation.

325 questions
0
votes
2 answers

Why does my Django Model not work correctly?

Currently making a basic Django project, following a well set out tutorial off youtube. All's going well and I usually try to debug issues myself and I wouldn't be asking if I was stuck. Issue: This code is meant to check the image size once it's…
Tobsterr
  • 35
  • 6
0
votes
1 answer

Django - [Errno 2] No such file or directory error: when attempting to save an uploaded file to a dynamic url

Models.py: class Enterprise(models.Model): name = models.CharField(max_length = 100) def __str__(self): return f"{self.id}_{self.name}" class Client(models.Model): name = models.CharField(max_length = 100) def…
0
votes
1 answer

Django Dynamic initial values for current user file upload

I've be struggling the last to days. I want the current user to be able to add a file without selecting himself the user of the file being uploaded. For now, I need to manually select a user from the list to add a file related to him. Big thanks in…
0
votes
1 answer

In Django, how can one access file fields in forms.py?

I have this form class in forms.py in my Django application: class EmailForm(EmailFormWithoutAttachment): attachment = forms.FileField() I would like to access the file uploaded in forms.py for validation via a clean function to validate its…
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
0
votes
1 answer

How to get the text file which is uploaded from android device and store it in a folder using django?

I want to save the text file or zip file in folder which can be uploaded in mobile devices(Android,IOS) using django framework.How to get the file in request ? Thanks in advance
0
votes
1 answer

I can't validate a file field in my Django form

Form from django import forms class XLSForm(forms.Form): xlsx_file = forms.FileField(help_text="The XLSX file") column_1 = forms.ChoiceField(help_text="Column 1 from XLSX") column_2 = forms.ChoiceField(help_text="Column 2 from…
trshmanx
  • 600
  • 7
  • 16
0
votes
0 answers

Passing image file from React to Django backend

I am trying to upload a file on the frontend in React and pass that image file to the backend in django to run some code on the image. Right now, the data from React is being passed as a bytes array but when I reconstruct the image in the Django…
pluto
  • 1
0
votes
1 answer

Django sorl: not enough values to unpack (expected 2, got 1)

I am trying to have a form to generate thumbnails from images that will be uploaded I will be using sorl for the thumb generation and I am following the following documentation: Django multiple file upload:…
Manza
  • 2,109
  • 1
  • 27
  • 34
0
votes
0 answers

upload multiple images without forms in django

This is my models.py class Upload(models.Model): images = models.ImageField(upload_to='image/') serializers.py class UploadSerializer(serializers.ModelSerializer): class Meta: model = Upload fields = '__all__' views.py class…
Titan
  • 244
  • 1
  • 4
  • 18
0
votes
0 answers

Can't upload multiple images in Django from react

Im sorry to ask this because there may be lot of tutorials for multiple file upload in django. but none of them clarified my doubts. Im new to Django please be patient with me. Below is my django codes: models.py class Upload(models.Model): file…
Titan
  • 244
  • 1
  • 4
  • 18
0
votes
1 answer

How to download uploaded directory as a zip file from django admin?

I have uploaded directory using django and JavaScript. Now I am trying to download this directory from django admin. For this purpose I have followed this link click here. When I have uploaded directory in django, the admin created the following…
0
votes
1 answer

Django save a file from an html form file field

in my django project i create my models like thisone: class v_candidatura(models.Model): c_data = models.DateTimeField(auto_now=True, verbose_name="Upload") c_tit = models.CharField(max_length=5, verbose_name="Titolo") c_sur =…
Manuel Santi
  • 1,106
  • 17
  • 46
0
votes
2 answers

Is it possible to have an external file input for choicefields in django?

I have ChoiceField in my Django model which consist of several choices and i am using the CheckboxSelectMultiple widget in forms to have multiple select options. models- BREAKFAST_CHOICES = (('fruits', 'A bowl of fruits with nuts'), …
0
votes
1 answer

How to receive optional values in django views through a form(not a django form), if user doesn't enter the value as it is optional?

As my image option is optional , I want to save it even if the file is not uploaded as it is optional, but it is giving me error as it is not able to receive the image. How can I save it in the database even if that field is empty? and even in case…
0
votes
0 answers

is there any way to display jupyter notebooks with django

I am really new on these things and i want to create a blog that i can publish my data notes and other articles. I want to learn if there is any way to display my jupyter notebooks or (.pdf, .docx, etc.) files directly on my website? I am already…