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
0
votes
1 answer

Serving Media in Production

This is well known topic, on how to setup, serve MEDIA Files, but there is a lot of no no to serving them in production, this is just one example from answered question on SO, Django does not serve MEDIA_ROOT by default. That would be dangerous …
copser
  • 2,523
  • 5
  • 38
  • 73
0
votes
1 answer

How to convert text from TextArea to file?

I have a form where User can fill either text to translate or attach a file. If the text to translate has been filled, I want to create a txt file from it so it seems like User uploaded a txt file. if job_creation_form.is_valid(): …
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
0 answers

Change Static Root Directory and Uploading in Django

I am following 2 different tutorials on creating a Django App. In one video (on lynda) it states that my static (javascript/css/image) files should live here: project_name/project_name/static/ I have a js and css file in there and it links up to my…
Kervvv
  • 751
  • 4
  • 14
  • 27
0
votes
0 answers

Uploading a stack of images in Django

I'm getting used to Django and I want to upload a stack of images via browser. The user must be able to upload the whole stack from one field to store the images in the database keeping the order. I think I'm looking for something like: Class…
MrPavlo
  • 11
  • 3
0
votes
1 answer

Django cant upload image

I am trying to add avatar to my model, but uploading dosent work. settings.py MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') MEDIA_URL = '/media/' models.py class Casting(models.Model): ... casting_picture =…
0
votes
1 answer

keep getting integrityError when trying to implement django-multiupload

I keep getting the following integrityError when trying to implement the django-multiupload app: null value in column "post_id" violates not-null constraint DETAIL: Failing row contains (9, post_images/1899987_718836594813781_835045800_n.jpg, ,…
ollysmall
  • 633
  • 2
  • 7
  • 13
0
votes
2 answers

Is there a way to only allow for images to be uploaded when using django-multiupload?

as the title says, is there a way to only allow for images to be uploaded when using django-multiupload? At the moment my users can upload any file but I want to limit them to only images. Any help/advice would be much appreciated :-)
ollysmall
  • 633
  • 2
  • 7
  • 13
0
votes
1 answer

Images are not being stored?? - Django

These are my following settings: MEDIA_ROOT = '/home/webapps/test_project/media/' MEDIA_URL = 'http://192.168.0.2:8090/site_media/' ADMIN_MEDIA_PREFIX = '/media/' These are my model fields: large = models.ImageField(blank=True, null=True,…
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
0
votes
1 answer

where django create InMemoryUploadedFile object of uploaded file?

when a HTTP Post request came with a file , django will create a InMemoryUploadedFile instance for each uploaded file. I'd like to extend InMemoryUploadedFile and add a few field and finally customize the upload file behavior of django. I took a…
Mahdi
  • 150
  • 1
  • 1
  • 10
0
votes
1 answer

Django image upload succeeds with url written to DB but no image shows upload target folder

I have form in Django class BusinessForm(forms.Form): name = forms.CharField( required = True, max_length=MAX_NAME_LENGTH, …
Saher Ahwal
  • 9,015
  • 32
  • 84
  • 152
0
votes
1 answer

Upload image to User profile

I'm trying to make a custom User Profile for the first time. All works good, except an ImageField. When I try to select image and hit Update button on the template page - image doesn't uploads to the destination folder and I see no DB change…
s.spirit
  • 343
  • 1
  • 7
  • 19
0
votes
1 answer

Validate uploaded file format and show error if it's not intact in Django admin page

I have my own text data file format to my Django application. After uploading one file to Django through admin page, how can I show error to admin uploader if file contents is not in proper format? Is there common way to handle this situation?
Wonil
  • 6,364
  • 2
  • 37
  • 55
0
votes
0 answers

Image not uploaded - Django Server

I'm trying to send an image android(client) to django(server) by converting it into base64 string. I've received the string @ the server side, decoded and renamed it.However, when I try to save the image it fails. Here's the path where the image is…
omarsafwany
  • 3,695
  • 8
  • 44
  • 75
0
votes
1 answer

Django cannot use pk on upload_to in an object yet saved

I have built a wizard in my project. In the first step I create an object "Building" and save it in the db. In the second step I let the user upload an image of the building saved in the first step. The image is in the Building's model. When I try…
Marco Fedele
  • 2,090
  • 2
  • 25
  • 45
0
votes
2 answers

Why is my image upload failing in django?

I am trying to build a django app and host it on webfaction. My model looks like this: class Post(models.Model): title = models.CharField(max_length=512) image = models.ImageField(upload_to='blogImages/') body = models.TextField() …
quakkels
  • 11,676
  • 24
  • 92
  • 149