131 questions
1
vote
2
answers
113
views
Django Admin site css not loading so site is lokking broken
I am using django's admin site and in that css is not loadung so site is looking totally broken.In last 3-4 days i almost tried everything which is available around the web to fix it but its not ...
0
votes
0
answers
41
views
Invalid Argument: X-Amz-Security-Token when my django-based website hosted by vercel tries to get static files from cloudflare r2
First of all: I have a R2 bucket on cloudflare that is public, allows any origins and any headers, and works completely fine.
I'm using django-storages to storage and retrieve static files from that ...
1
vote
0
answers
50
views
Django does not change the default storage system [duplicate]
I have a django application that works perfectly fine with storing media locally. I have decided to change the default storage to be able to store files on a remote cloud system (s3), I set the ...
0
votes
2
answers
552
views
Django storages + boto3 not working. Keeping static files local while uploading media files to S3
I'm trying to setup a django project in such a way that static files are kept in the filesystem and media files are uploaded to an amazon s3 bucket. The django storages library had an update for ...
1
vote
1
answer
90
views
Django templates and css: is there a workaround for getting my preload link tags to match my css relative paths to font sources?
Background
I just started using Digital Oceans Spaces for storing my static files for my Django web app (connected using django-storages library). Previously, I used link elements in the head of my ...
2
votes
1
answer
198
views
When using django-storages with a cloud storage service, is there a way to make the collectstatic management command run faster?
Issue
I recently connected my Django app to Digital Ocean Spaces using the django-storages library, and suffice it to say I have a lot of static files (currently 2545 files, most of which are small-...
1
vote
0
answers
150
views
custom storage-backend class not working as expected with s3, boto3 and django-storages
I am following this tutorial here from Michael Herman, trying to setup s3 storage for my django project and I am facing some issues right from the start of the tutorial.
First, when I tried running ...
-1
votes
1
answer
67
views
getting an empty folder in django new project
I created a virtual environment than I installed Django successfully but when I try to create a project with Django-admin start-project project-name Django create an empty folder?
I'm expecting a ...
2
votes
0
answers
798
views
Python Django ASGI - memory leak - UPDATED #2
EDIT 25.04.2024:
malloc_trim(0) seems to work. I need to test how the server memory consumption looks like in the long run, though.
This is modified asgi.py which starts deamon thread which invokes ...
1
vote
1
answer
491
views
Pre-Signed URL with boto3 and django-storages incorrect filepath
For a file upload feature, I'm trying to set a FileField in Django using a presigned url but when the field is saved it seems that the aws bucket name is being added into the url so when I try to ...
0
votes
1
answer
329
views
Storing files to S3 not working inside Celery worker
I am facing issues with storing files in S3 from django's celery task. I am doing following things
Get data from DB
Create the XLSX file with BytesIO
Storing that file with file.save method of Django
...
0
votes
0
answers
215
views
Uploading large file to GCS with django and django-storages -- direct or multi-part uploads?
I'm creating a django application that uploads multimedia to Google Cloud Storage using django-storages. My application is running on Google App Engine; I'm using the admin interface for admins to ...
2
votes
0
answers
266
views
Problems configuring my Django project to upload static and media files to DigitalOcean Spaces
I have created a social media app using Django and Vue. My frontend is hosted on Vercel (which is working just fine) and my backend is hosted on DigitalOcean's App Platform (I am NOT using a droplet) ...
1
vote
1
answer
1k
views
ModuleNotFoundError: No module named 'storages'
I no idea why this error kept occur in my terminal
my current django version, 4.2.3
python version, 3.10.6
and my virtual environment is on, and I did downloaded these pip
pip install boto3
pip ...
0
votes
1
answer
221
views
SignatureDoesNotMatch DigitalOcean Spaces Boto3 Django-Storages Django
You got the following error while using your digital ocean spaces for static files:
<Error>
<Code>SignatureDoesNotMatch</Code>
<RequestId>xxxxx-716fe6ea-xxxx</RequestId>
&...
0
votes
1
answer
72
views
how to activate my virtual environment without having any error
venv\Scripts\activate.bat : The module 'venv' could not be loaded. For more information, run 'Import-Module
venv'.
At line:1 char:1
venv\Scripts\activate.bat
+ CategoryInfo : ...
0
votes
1
answer
211
views
Django LIKE operation
I'm trying to send a query through Django python
I also try to block any sql injection exploits
Can someone explain to me how messaging is done
LIKE Query
for example
"SELECT * FROM admin WHERE ...
0
votes
1
answer
56
views
How to set cachecontrol for different types of image differently without overriding get_object_parameters using django-storages
I have multiple apps and each app has different cachecontrol requirement. get_object_parameters provides us. But it will be big change for codebase. Instead is it possible to pass cachecontrol to ...
8
votes
2
answers
8k
views
Could not find config for 'static files' in settings.STORAGES
This error occurs when running Django 4.2.The Default: django.contrib.staticfiles.storage.StaticFilesStorage has been deprecated.
0
votes
1
answer
69
views
How to upload file in django and access in another module?
I'm usind django e plotly dash to make a dashboard in my page. In this application we will to make a upload file, but this file have to save in "C:\tmp\Uploads". How can i make this and ...
0
votes
1
answer
773
views
Deploying Django App to Azure Storage Error
I've been following this tutorial on deploying my django app on Azure: https://testdriven.io/blog/django-azure-app-service/
Everything was working fine until I added Azure storage. Now my webpage is ...
0
votes
1
answer
1k
views
LocalStack and django-storages use custom url with s3.localhost.localstack.cloud
I have a Django REST Framework application that has a model with an ImageField:
def upload_to(instance, filename):
return f'images/model1/{instance.owner.pk}/${filename}'
class Model1(...
-1
votes
2
answers
499
views
Keep on getting this error message when trying to run my django server: [Errno 2] No such file or directory [closed]
I'm trying to run my django server but keep on getting this error, [Errno 2] No such file or directory.
I tried using the cd manage.py command but also got this error cd : Cannot find path 'C:\Users\...
0
votes
1
answer
2k
views
Getting "S3 Transfer Acceleration is not configured on this bucket" error when using django-storages
In a Django project that uses django-storages and is configured with AWS credentials, I am getting the following error when uploading a file (i.e. saving a model that has a models.FileField field)
An ...
0
votes
0
answers
55
views
Django admin site foreign key
I have created some classes like STATE, DISTRICT, TALUK, and VILLAGE. Admin needs to add details in the admin panel.
If the admin needs to add TALUK, he must select provided STATE, DISTRICT.I used a ...
0
votes
1
answer
630
views
How to upload file using django-storages to S3 without giving AWS credentials
I want to upload a file from my django-admin page to S3. I read the document of django-storages but my concern is that it requires AWS Credentials to be added in the settings.py. Which i don't think ...
0
votes
1
answer
2k
views
Image files were deleted by itself in AWS-S3 [closed]
I'm using python Django framework for server and AWS-S3 for store uploaded image.
Also, i'm using django-storages library for handle S3.
But sometimes images were deleted by itself not through django ...
1
vote
0
answers
91
views
get_serving_url silently fails with django-storages, app engine, python 3.x
I am trying to get the seving_url for a project that uses django-storages with google cloud storage for media files.
I am trying to serve the files with get_serving_url, but I get a silent failure ...
0
votes
1
answer
183
views
BooleanField in ModelSerializer
I want to display the content of Trader class through an API call. But I don't know where am I wrong.
models.py
class Trader(models.Model):
user = models.OneToOneField(User, on_delete=models....
1
vote
1
answer
1k
views
Django: Table doesn't exist( python manage.py migrate) [duplicate]
I dropped some table related to an app. and again tried the syncdb command
python manage.py migrate
It shows error like
django.db.utils.ProgrammingError: (1146, "Table 'homeapp_enroll_course' ...
1
vote
2
answers
1k
views
Django S3 private storage
Users in my django project can upload pdf files to a private storage. It is done using django-private-storage package - when user makes a request to get a file, django checks permissions on that and ...
0
votes
1
answer
139
views
django-pipeline not working with S3Boto3Storage
How can I use S3Boto3Storage with django-pipeline?
According to the docs it looks like it would work:
https://django-pipeline.readthedocs.io/en/latest/storages.html#using-with-other-storages
The ...
0
votes
1
answer
868
views
Django storages: Need authenticated way of reading static files from google cloud storage
I am trying to read static files from GCP storage using a service account key. The problem is while most of the requests are authenticated django-storages, some of the requests are public.
Developer ...
2
votes
2
answers
1k
views
Django - Accessing static/media files always from a remote MEDIA_URL instead of local one during development
I have a Django app running on a server and I would like to continue working on it locally with the runserver command. My problem concern the use of common static and media files. The media folder ...
1
vote
1
answer
52
views
can any one tell how can i get an appropriate output only using a foreign key in models
this is my models.py file
models.py
from django.db import models
from django.utils import timezone
class Movielist(models.Model) :
Title = models.CharField(max_length=1000)
Description = ...
0
votes
1
answer
103
views
i have to make a relation between movie and actor without using manytomany field i have to use only foreign key in django i've write this code so far
models.py
class Movielist(models.Model) :
Title = models.CharField(max_length=1000)
Description = models.TextField(blank=True)
ReleaseDate = models.DateTimeField(...
2
votes
1
answer
937
views
Migrating from Client-Django-S3 image/file upload to Client-S3 Presigned URL upload, while maintaining FileField/ImageField?
The current state of our app is as follows: A client makes a POST request to our Django + DRF app server with one or more files, the django server processes the files, then uploads and saves it to S3. ...
0
votes
1
answer
759
views
Django Admin S3 Private Media Files
When using the private media django-storages class below. When I view the uploaded file in the admin it does not generate the URL Query String Authorization parameters.
from django.conf import ...
2
votes
1
answer
695
views
Why is collectstatic only detecting admin static files?
I'm using S3 to store my static files, but I'm having an issue where only the admin static files are uploading to the bucket.
I expected to see the css and other folders from inside static upload to ...
1
vote
1
answer
999
views
Using non-AWS S3 storage with Django?
I have an S3 storage which is not hosted by AWS. I tried my AWS account as a file-storage, which worked fine, however, when I switch the credentials to the non-AWS provider I get:
botocore.exceptions....
0
votes
0
answers
309
views
Unable to upload files/images to cloud storage (GCP) with Django
I am trying to upload files & images to the GCP bucket which I created a while ago. I am using Django rest-framework as the backend. I came across this library called [django storages][1]. I did ...
-1
votes
2
answers
545
views
Class inheritance python
In the case creating a model, for example
class Student(models.Model)
name=models.charfield(),roll=models.integerfield()
similarly,
In the case creating a form, class newform(forms.Form)
name=forms....
0
votes
2
answers
1k
views
django storages breaks the admin staticfiles
I tried moving from local static files to S3 using django-storages. I followed the documentation carefully but still there is no access to the static files.
In the local environment I have:
STATIC_URL ...
1
vote
1
answer
1k
views
Django static files to AWS S3 return 403 forbidden
I'm working on a Django(3) project which is deployed at Heroku. I'm trying to connect AWS S3 using Django Storages to upload Static and Media files to S3 Bucket.
Note: I have googled a lot and tried ...
3
votes
1
answer
3k
views
Custom S3Boto3Storage with django-storages
I developed a Django app that I'm using VM's disk for saving and serving media and static files but in one of my models, I want to save my files in a FileField connected to my MinIO object storage. I ...
0
votes
1
answer
550
views
Angular Interceptor do not send response header
My GET, POST rquests works fine when there is no set headers in interceptors.
If I do setHeaders in interceptors to set my userId data, 2 things I can see in Network tab:
No response headers are seen ...
2
votes
2
answers
2k
views
Where to store media file of Django on production?
So I am learning Django. And I have made some websites with it. Now I am hosting those to Heroku. I am using free Dyno on Heroku. Also, I am using supabase.io database instead of Heroku's because ...
0
votes
1
answer
1k
views
Django Storage and Boto3 not retrieving Media from AWS S3
I am using a development server to test uploading and retrieving static files from AWS S3 using Django storages and Boto3. The file upload worked but I cannot retrieve the files.
This is what I get:
...
0
votes
0
answers
367
views
DJANGO-STORAGES, PARAMIKO: connection failure for global connection
I have a strange problem using the SFTP-API from django-storages(https://github.com/jschneier/django-storages). I am trying to use it in order to fetch media-files, which are stored on a different ...
6
votes
2
answers
3k
views
Django-Storages with SFTP: GET-requests fail
I am trying to use django-storages to access my "Hetzner" Storage Box (https://www.hetzner.com/storage/storage-box) using SFTP which should hold media data, i.e. image files which users of ...