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

django upload file to custom location

Is it possible to upload a file in django using django's model.FileField() to a location that's not relative to /media ?. In my case upload an .html file to myproject/templates.
Paulo
  • 6,982
  • 7
  • 42
  • 56
0
votes
2 answers

Obtaining file type in django template

I need to get the file type of the uploaded file in django template. I have written a templatetag for getting file name but I need file type also. I might be able to get the content-type of the file but I couldn't find it while…
brsbilgic
  • 11,613
  • 16
  • 64
  • 94
0
votes
2 answers

Django: Making filefield only available to logged in users

How can I make the FileField only available to download for logged in users ?
Hellnar
  • 62,315
  • 79
  • 204
  • 279
-1
votes
1 answer

Image not getting uploaded in Django

I tried to save a record using two different methods but both are not working. Django Form Models (create method) 1 I have created a ModelForm class ProductForm(ModelForm): class Meta: model= ProductDetails fields=…
-1
votes
1 answer

adding and displayin E-Books in django

I am working on a project for selling E-Books but I want to know the best way to display E-Books and handling them considering that users can not download or copy E-Books and can just read them can anyone help me what can I do?
-1
votes
1 answer

Django Retrieve CRSF token

I would like to retrieve the CRSF token so I can do a POST externally from the website e.g via POSTMAN, or other external applications. I have exposed an API endpoint for user to upload files which they can do directly inside of doing it from…
bawagoc25
  • 33
  • 3
-1
votes
1 answer

How to access csv file data in django?

I want a webpage in django that accepts csv file from the user and need to process that data.could you please help me
-2
votes
2 answers

How to import images in django models from csv/excel?

This is my model. class Product(models.Model) id = models.AutoField(max_length=10, primary_key=True) name = models.CharField(max_length=60) summary = models.TextField(max_length=200) image =…
Abhishek Balani
  • 3,827
  • 2
  • 24
  • 34
-2
votes
1 answer

Django Rest_Framework File upload using Ajax

I'm beginner of django rest_framework. I want to implement file upload feature to my project, and I did some search, but I could not get any helpful example. So, is there somebody who can tell me some reference or example in rest framework file…
JunoJunho
  • 75
  • 1
  • 1
  • 8
-2
votes
2 answers

File upload error & csrf error when Method is post even if {% csrf_token %}

Ok, I know there is many question same to mine, but I didn't find any answer to solve my problem.I am newbie to Django, so please keep in mind. I need to do a from which will upload a file: Here is my upload.py(which is a views.py) from django.http…
Swagat
  • 617
  • 5
  • 16
1 2 3
21
22