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

How does Django rename uploaded files?

If upload a file image.png from a web browser, a new file named image.png will appear in the upload directory on the server. If I then upload another file named image.png (same name), a new file named image_aj642zm.png will appear in the upload…
Flux
  • 9,805
  • 5
  • 46
  • 92
3
votes
4 answers

Upload File using Angular and Django

So, I have a issue that i cant find a solution for. I am developing an application using Django where my front end has to be in angular-js. Now I am able to render forms and also post the data from the forms, but i have no idea how to upload a file…
prats
  • 225
  • 5
  • 15
3
votes
0 answers

IOError: failed to write data - Python Server

Any idea why the following error occurs when uploading image to server?! [Tue May 21 23:44:01 2013] [error] [client 41.236.182.133] mod_wsgi (pid=9639): Exception occurred processing WSGI script '/root/AR_BROWSER/example/wsgi.py'. [Tue May 21…
omarsafwany
  • 3,695
  • 8
  • 44
  • 75
2
votes
3 answers

Simple Django Image Upload - Image file not saving

Right I'm learning how to do a simple image upload form to upload an image to MEDIA_ROOT. The form renders fine, I get no errors, but the file is not showing up in the MEDIA_ROOT directory. If followed the documentation example and can't get it to…
Amir Rustamzadeh
  • 4,302
  • 7
  • 35
  • 43
2
votes
1 answer

Upload Image in the wrong directory in django ImageField

When I upload a photo, the photo is loaded successfully, but the photo is placed in the wrong directory. Instead of placing the image on the path to 'media/posts-pics/' - as I have outlined in my Post model - it is placed on the 'media' path. These…
rahnama7m
  • 865
  • 10
  • 38
2
votes
2 answers

Serialize multiple InMemoryUploadedFile using ListField : Django REST Framework

How can I serialize multiple InMemoryUploadedFile using serializers.ListField() ?? code snippet #views.py @api_view(['POST', 'GET']) def create_post(request): if request.method == 'POST': altered_request_data = request.data.copy() …
JPG
  • 82,442
  • 19
  • 127
  • 206
2
votes
2 answers

Django ImageField - render only the element

I have a Django form which has an ImageField in it, and I render the field like this in my template: {{ form.my_image_field }} The resulting HTML looks like this: Currently: ....jpg
Babken Vardanyan
  • 14,090
  • 13
  • 68
  • 87
2
votes
1 answer

Django-models: use field from foreign key

I'm working on an image gallery project in DJango, just for the sake of it. And well, I have a class named Gallery and a class named ImageGallery. The class named gallery would look like this: class Gallery(models.Model): gallery =…
gglasses
  • 826
  • 11
  • 30
2
votes
2 answers

How to upload multiple images in Django using Dropzone and saving path dynamically ?

I am working on a Django project where users should be able to upload images using Dropzone.js At the moment user images would be saved under mypp/images folder However I would like to save the path of uploaded images dynamically. E.g.…
2
votes
3 answers

Django Is it efficient for DB to store uploaded files in model?

I have a form and if I store the file using form.save(), is the entire file content stored in DB or just the file path? Suppose I have hundreds of thousands or millions of files. Is it efficient to store all of them in DB because size of the table…
hoan
  • 87
  • 1
  • 7
2
votes
0 answers

iOS how to upload image to Django?

Could someone give me some code (iOS side and Django side) to show me how to let iOS upload the image to Django, and Django rename it and save it in the /static/ folder. This is my Django Model class UserAccountInfo(models.Model): usignup_email…
zproject89
  • 225
  • 5
  • 19
2
votes
1 answer

How to refuse an upload before it completes in Django?

I would like my Django application to decide whether to accept or reject an upload based on request headers and/or session data. If the upload is to be rejected, I would like the app to reset the connection rather than waste time receiving and…
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
2
votes
2 answers

Temporarily upload profile image in Django during registration?

In a Django application, during registration, I want the user to be able to see the profile image he/she selects, rather than just see a path as done purely using django forms (for an example of what I want see pinterests registration form). I…
ip.
  • 3,306
  • 6
  • 32
  • 42
1
vote
1 answer

Django Upload Images

I have been trying to work with the uploading features of Django but I just can't seem to get it to work. My form already contains enctype="multipart/form-data" so that can't be the issue. Anyways here's what im working with: This is my model class…
cclerv
  • 2,921
  • 8
  • 35
  • 43
1
vote
1 answer

how to make an api that gives an image from some custom directory in django rest framework

I am writing the backend code of a website in which there are movies and tv shows. And each film has a poster which can be used on the frontend. these posters are saved in a specific directory folder (let's say "\Posters"). What I need is an API…