Questions tagged [django-uploads]

Django-uploads refers to how django handles file uploads

Django-uploads refers to how django handles file uploads

See also:

91 questions
1
vote
2 answers

ValueError on ImageField when trying to delete image or creating new user in Django

I have put an ImageField on my Django model, and with the pre-existent profiles it works (the image upload), but I can't delete the image from the admin panel and I can't create a new user. The thrown error is: ValueError at…
Stefano De Rosso
  • 1,309
  • 1
  • 14
  • 27
1
vote
1 answer

File upload form in Django

I'm trying to create a simple upload form for my project in Django 1.5 an Python 2.7. This is my File class: class File(models.Model): middleschool = 'MS' highschool = 'HS' university = 'U' blank = '-' school_choices =…
Higure
  • 235
  • 1
  • 5
  • 19
1
vote
3 answers

Image upload and Manipulation in Django

I am trying upload images and than create an thumbnail of it and than store both in S3. After the file has been uploaded i am first uploading it to S3 and than trying to create thumbnail but it doesn't work as than PIL is not able to recognise the…
1
vote
1 answer

Issues with display multiple images

I want to display images which are stored in database. If I used this. in view product = Upload_files.objects.get(id=1) and in form then it will show the image of id=1 . But if I want to display all…
user786
  • 383
  • 1
  • 3
  • 15
1
vote
2 answers

How to deselct something when selected previously in FileField Django Form?

I have a form which includes filefield to upload some files. Sometimes what happens is at first, I select one file from browse to upload but then i realize i do not want to upload it anymore.How can i make it empty again?? Is it like that once this…
Karan
  • 239
  • 4
  • 13
0
votes
1 answer

Django upload Form error: 'InMemoryUploadedFile' object has no attribute 'COOKIES'

Hi I'm new to Django I'm trying to build a simple upload application. forms.py from django import forms class Song(forms.Form): song = forms.ImageField() models.py from django.db import models class Song(models.Model): song =…
LonnyT
  • 590
  • 1
  • 8
  • 21
0
votes
1 answer

Django Forms uploading image - form data works except for image

I'm trying to get uploading working with Django. I don't get an error when I try to upload it, and the new Item is saved, but there is no image. The other form data is all there. I've been googling and on stack overflow for the past 2 days and…
0
votes
0 answers

Django chunked upload

I have a Django app in which the user can upload a tdms file. When I deploy it, this does not work for large files, which is why I want to implement chunked upload through the django-chunked-upload library. I gave it a go, but I really need help. I…
0
votes
3 answers

form doesn't appear - UnboundLocalError at / DJANGO FORM

my form doesn't appear at my website and its error now. this is my error message : UnboundLocalError at / local variable 'form' referenced before assignment Request Method: GET Request URL: http://localhost:8000/ Django Version: 3.0.14…
Monana
  • 43
  • 1
  • 5
0
votes
1 answer

DJANGO FORM - how to change save location file uploaded

i don't use models form but only form. How to change location file when i uploaded? i want the file just go to /mp3 folder. And now it not move to anything (the file didn't got upload). and this my code : def homepage(request): if request.method ==…
0
votes
1 answer

How to check if FileField was uploaded?

I wanna store the "original" file name of an upload. This is because the file gets stored with a uuid as a new name. So I wrote this for my model: def save(self, *args, **kwargs): if self.file: self.original_filename =…
JasonTS
  • 2,479
  • 4
  • 32
  • 48
0
votes
1 answer

cloudinary download PDF

I have a django app and I let my users upload files to a Cloudinary account I set-up. I am no trying to allow users to download those files back by clicking on link (that supposedly should trigger a download from Cloudinary). I am failing to achive…
giaggi
  • 542
  • 5
  • 16
0
votes
1 answer

Django upload and read vcard object - loosing my mind

I am trying to let users of my Django app upload vcards through a form, parse those vcards on the fly and then serve some of the content back to the front-end without storing the vcards on server. I have successfully found a way to read and extract…
giaggi
  • 542
  • 5
  • 16
0
votes
3 answers

How do I read a request.FILES into DataSource in Geodjango

So, the goal is to create a webpage to load a .shp file into and get a summary of some calculations as a JsonResponse. I have prepared the calculations and everything and it works nicely when I add a manual path to the file in question. However, the…
mkw
  • 123
  • 2
  • 10
0
votes
1 answer

Migrating Django app to use online media storage

I have a Django app running on a server. Currently user uploads are stored on the server filesystem. I already know how to set up S3 storage. What is the best way to migrate existing uploads to S3 without breaking the API and having existing uploads…