Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

I have a Files model which has the User Model as Foreign key, I want to use the user's username as the name of the folder to which the files of the particular user will be uploaded. How can I achieve ...
Khushal's user avatar
  • 799
0 votes
1 answer
47 views

I am building an app in django (Django==3.1.14). the app should allow the user to upload zip files (in particular, they are shapefiles). I want django to upload and manage these files by storing them ...
Tms91's user avatar
  • 4,409
1 vote
1 answer
79 views

I am developing a Django application where users can upload files associated with specific topics and submissions. Despite setting up everything according to the Django documentation, the files do not ...
Nika's user avatar
  • 73
0 votes
0 answers
422 views

I'm working on a Django project where users can upload video files, and I need to convert these uploaded videos into the M3U8 format for streaming purposes. Could anyone provide guidance or a code ...
rowsen's user avatar
  • 87
0 votes
0 answers
32 views

I'm making a site on Django. The functionality is as follows - users can download pdf files for processing (converting to different formats, extracting text, etc.). This is how I receive a file from a ...
Mikhailo's user avatar
1 vote
1 answer
662 views

I have two similar forms for upload files, but I want to save files in different directories depending on the form. Let me explain, for example: if User uploaded file from Form_1 -> file should be ...
macder's user avatar
  • 131
1 vote
1 answer
193 views

I have a Django model with custom clean function as below: class License(models.Model): # fields of the model def clean(self): if condition1: raise ValidationError('Please ...
mohammad's user avatar
  • 2,218
1 vote
2 answers
5k views

Note: Please read the whole question before marking it as duplicate. Django has changed ALOT Since a couple of years. I have already tried all the solutions and read Django Rest Framework ...
nabiharaza's user avatar
0 votes
1 answer
729 views

I want to store images and pdf files in the database directly and not in the folder storage, what field type should be given in models along with other information which will be stored in another ...
nikil shetty's user avatar
0 votes
1 answer
183 views

While trying to upload a file using django cms filer I am getting the following error `*Internal Server Error: /admin/filer/clipboard/operations/upload/1/ Traceback (most recent call last): File &...
Oleg Rud's user avatar
0 votes
0 answers
266 views

I'm going to use DigitalOcean Spaces as a file storage and I want to add suffixes to uploaded filenames for two reasons: impossible to guess file url with bruteforce ensure it is unique, as I'm not ...
Milano's user avatar
  • 18.9k
-1 votes
1 answer
83 views

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: ...
Chetan Rathod's user avatar
0 votes
1 answer
152 views

I am building a web page where a blog author can write content and upload images. Using an image field, I am allowing the author to upload multiple images and with some Javascript logic, I am ...
NFSpeedy's user avatar
  • 171
0 votes
1 answer
194 views

I am trying to upload files (single and multiple) with an UpdateView via an update template but I keep getting a 'This field is required' error when I submit, and the files aren't uploaded, of course. ...
Uwa Isibor's user avatar
0 votes
0 answers
61 views

I have a model like this: class Cohortpdfs(models.Model): id = models.AutoField(primary_key=True,editable=True) title= models.CharField(max_length=200,validators=[MaxLengthValidator(100)]) ...
Md. Redwan Ali Rafi 1921161642's user avatar
0 votes
0 answers
193 views

I need to convert uploaded PDF to images. I'm using pdf2image function convert_from_path() to convert the image but am getting an error Unable to get page count. My code looks somewhat like this: ...
Marian's user avatar
  • 23
2 votes
1 answer
175 views

Given the following model I am attempting to use the models ID field (a UUID) in the upload_to path but its defined as None, presumably as it hasn't been generated at that point. If I use a UUID field ...
Ryan's user avatar
  • 24.6k
0 votes
1 answer
150 views

I try to upload some files to a server through a web interface with Django. HTML : <form method="post" enctype="multipart/form-data" name="upload_file"> {% ...
Gautitho's user avatar
  • 623
0 votes
1 answer
344 views

I am writing my first react-native app with a django backend. for my app to work properly I need to send an image from the device's image library to the django server and then save it in the model. ...
Itay Lador's user avatar
1 vote
1 answer
242 views

I am using the django framework. And I just want to upload an image. So I have this: views.py: # Create your views here. def store_file(file): with open("temp/mensschappy.png", "wb+...
mightycode Newton's user avatar
1 vote
1 answer
2k views

Upload a tar file. How to get the file object in request.data? class AlbumViewSet(viewsets.ModelViewSet): @action(methods=['POST'], detail=False, url_path='upload-album') def upload_album(...
Jeffrey Hao's user avatar
0 votes
1 answer
42 views

I'm not getting an error message---but when the Delete button is pressed in my template, nothing happens. Does anyone see what's missing in my code below? settings.py MEDIA_URL = '/home/' MEDIA_ROOT = ...
Condado's user avatar
  • 65
3 votes
2 answers
2k views

I have the bytes of a file saved in my Django database. I want users to be able to download this file. My question is how do I convert bytes into an actual downloadable file. I know the file name, ...
user avatar
0 votes
1 answer
519 views

In my django project I have to save an image from views.py to the database here is my models.py class Mymodel(models.Model): id=models.IntegerField(unique=True,primary_key=True) name=models....
paul kv's user avatar
  • 11
0 votes
0 answers
2k views

I am working on an e-commerce project, and I want to add products from the front end. The files in my product app in Django is as follows this is my model.py: class Product(models.Model): ...
afaf's user avatar
  • 3
0 votes
1 answer
694 views

I am trying to rewrite a function view that download files into a classview. However I don't see how to do it properly with the right methods, since I have an argument from the url. Then I do not ...
Goncalves's user avatar
  • 149
1 vote
1 answer
549 views

I am stuck to upload a multiple image file at duration of creating doctor model .. I think to implement multiple upload, you need to set the additional field for uploading in the DoctorSerializer. I ...
Gautam Ankul's user avatar
0 votes
0 answers
909 views

I've an application where my users create a video-file (mp4) which is saved as a Filefield in the model. In my view I add the object (model) to the context of a TemplateView class. In my HTML I use ...
jefferson's user avatar
  • 155
0 votes
0 answers
177 views

I've an application that allows users to add a video. This video is an MP4 format and saved via a FileField to the model. I want to play the video via a fileResponse (view). This FileResponse plays ...
jefferson's user avatar
  • 155
0 votes
1 answer
75 views

When I fill out my form with its file, it apparently submits, but when checking it out when editing/uploading, all data in the form shows up except my file. So, I cannot access it at all. I guess it ...
Mario A's user avatar
  • 45
0 votes
1 answer
441 views

I have a simple Django FileForm for multiple files upload (basically txts with polygon coordinates). I don't want to save the uploaded files anywhere but only treat them on the fly (memory?) and ...
diml's user avatar
  • 166
2 votes
1 answer
886 views

I want to save file in automatically created folder related with Employee id_number like: media->employee->attachments->emp001->emp001.pdf models.py from django.db import models ...
Sandun Tharaka's user avatar
0 votes
1 answer
56 views

I have a django model form where I uploaded images for my app. I am just storing them temporarily locally since its not a real project. The Admin looks like this I'm wondering if there is a way to use ...
Keith Coye's user avatar
0 votes
1 answer
166 views

Getting this error: Exception Type: AttributeError Exception Value: 'InMemoryUploadedFile' object has no attribute 'save' When trying to have a Django function as simple as: def upload(request): ...
Waseem Saeed's user avatar
0 votes
1 answer
198 views

I'm new to django. I've been stuck for a while. I believe everything is configured correctly. However, when my objects are created it is not creating the media directory or storing the files/images. I ...
Keith Coye's user avatar
0 votes
1 answer
72 views

I've gone through about 8 tutorials across YouTube and Online websites. I believe everything is configured correctly. However, when my objects are created it is not creating the media directory or ...
Keith Coye's user avatar
0 votes
1 answer
765 views

I created a Django app with Video files. I'm using Gunicorn & Nginx. A user (not root) that runs the django server. I restricted the views so only the users with correct permissions can view these....
jefferson's user avatar
  • 155
0 votes
1 answer
57 views

i want to get the last file i was upload and it will be played in templates. but what i make it, every file i was upload, it can be played (so there’s so many audio player). what i want is just show 1 ...
Monana's user avatar
  • 33
1 vote
1 answer
1k views

I am rendering a simple form with a file field. class ReviewForm(forms.ModelForm): class Meta: model = Review fields = [ 'file', ] widgets = { ...
Chandragupta Borkotoky's user avatar
0 votes
1 answer
35 views

I am working in Django 3.2.13 trying to create a simple upload form for a file model with a chained foreign key. I have tried creating a form with a basic form model and a ModelForm, however, even ...
RandomDev2345's user avatar
0 votes
1 answer
122 views

i have problem. why my form doesn't show except i clicked submit button. is that any problem with my code? here's my html code : <form method="POST" enctype="multipart/form-data"...
Monana's user avatar
  • 33
1 vote
2 answers
2k views

I wanted to know the difference between using MEDIA_ROOT = BASE_DIR / 'media' and MEDIA_ROOT= os.path.join(BASE_DIR, "media") in settings.py.
nz_19's user avatar
  • 81
0 votes
1 answer
1k views

so i want when i upload a file, the file will go to media/mp3 not media/txt. how to change save file location? views.py: def homepage(request): if request.method == "POST": form = ...
Monana's user avatar
  • 33
2 votes
1 answer
463 views

I have a Django project which involves a user uploading a CSV file via a form. I parse this file in the forms clean method, and then in the views form_valid method I want to read the file data again (...
Josh's user avatar
  • 1,657
1 vote
0 answers
261 views

hello guys i try to display pdf file in my html page. i have this models: class HomeWork(models.Model): nameFile = models.CharField('Name File',max_length=30) file = models.FileField('File',...
Roni Jack Vituli's user avatar
0 votes
1 answer
631 views

I want to accept any type of file from the user and save it in the database. I am using following code: In HTML file : <input type="file" name="file_name" required> But when ...
Manoj Kamble's user avatar
0 votes
2 answers
368 views

What I wanted to achieve was for a user to upload a file through a form, lets say profile picture, My aim is to take that file, send it through imgbb's api and get the image url to store for use in my ...
Sammy Dasaolu's user avatar
0 votes
1 answer
912 views

I have one model Detail which has OneToOne relation with default User Model. I have a field FileField in my Detail model, where I want to upload the files using forms from frontend/templates. I have ...
Neha AK's user avatar
  • 67
0 votes
1 answer
781 views

I am using bootstrap as the template. The form is designed as the font awesome icon will be the file upload field in the design. Is there any way to do it? I have no idea about that. I am sharing the ...
Anny's user avatar
  • 303
0 votes
1 answer
1k views

I am trying to add a file extension validator in the Filefield of my model. But when I am adding a different extension file through my serializer it's adding the extensions I didn't put in my ...
Anny's user avatar
  • 303

1
2 3 4 5
7