Questions tagged [django-storage]

Django-storage refers to django file storage mechanism

Django-storage refers to django file storage mechanism.

Django has built-in file storage system. Additionally django provides a way to write custom storage classes.

See also:

314 questions
97
votes
6 answers

How to set-up a Django project with django-storages and Amazon S3, but with different folders for static files and media files?

I'm configuring a Django project that were using the server filesystem for storing the apps static files (STATIC_ROOT) and user uploaded files (MEDIA_ROOT). I need now to host all that content on Amazon's S3, so I have created a bucket for this.…
55
votes
9 answers

boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden

I'm trying to get django to upload static files to S3, but istead I'm getting a 403 forbidden error, and I'm not sure why. Full Stacktrace: Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) …
Levi Campbell
  • 6,005
  • 7
  • 40
  • 47
25
votes
3 answers

Storing images and thumbnails on s3 in django

I'm trying to get my images thumbnailed and stored on s3 using django-storages, boto, and sorl-thumbnail. I have it working, but it's very slow, even with small images. I don't mind it being slow when I save the form and upload the images to s3, but…
asciitaxi
  • 1,369
  • 1
  • 16
  • 16
24
votes
4 answers

Connection reset by peer when using s3, boto, django-storage for static files

I'm trying to switch to use amazon s3 to host our static files for our django project. I am using django, boto, django-storage and django-compressor. When I run collect static on my dev server, I get the error socket.error: [Errno 104] Connection…
jkeesh
  • 3,289
  • 3
  • 29
  • 42
20
votes
3 answers

django storages aws s3 delete file from model record

I have based my django aws S3 solution on https://simpleisbetterthancomplex.com/tutorial/2017/08/01/how-to-setup-amazon-s3-in-a-django-project.html. Now I am trying to find a way to delete a row in the model that contains the S3 file. I am able to…
Axil
  • 3,606
  • 10
  • 62
  • 136
18
votes
4 answers

Why does S3 (using with boto and django-storages) give signed url even for public files?

This is strange. I have mix of public as well as private files. I want normal urls in public files, and signed urls in private files. I tried to change AWS_QUERYSTRING_AUTH to False as I see by default, it's True in django-storages. But, when I…
chhantyal
  • 11,874
  • 7
  • 51
  • 77
18
votes
2 answers

Error "Could not load Boto's S3 bindings."

I have followed the very terse guide provided for django-storages, transitioned from local file storage, and have come up against this exception: Could not load Boto's S3 bindings. settings.py DEFAULT_FILE_STORAGE =…
michael
  • 2,577
  • 5
  • 39
  • 62
16
votes
1 answer

Pointing to multiple S3 buckets in s3boto

In settings.py I have: STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_ACCESS_KEY_ID = 'xxxxxxxxxxxxx' AWS_SECRET_ACCESS_KEY =…
Aziz Alfoudari
  • 5,193
  • 7
  • 37
  • 53
15
votes
3 answers

Store static files on S3 but staticfiles.json manifest locally

I have a Django application running on Heroku. To store and serve my static files, I'm using django-storages with my S3 bucket, as well as the standard Django ManifestFilesMixin. I'm also using django-pipeline. In code: from…
Danra
  • 9,546
  • 5
  • 59
  • 117
15
votes
5 answers

What permissions does django-storages require for an s3 IAM user?

As the question asks, what are the minimum required permissions for a locked down s3 IAM user to use django-storages successfully? At the present time I've used something like { "Statement": [ { "Effect": "Allow", "Action":…
jvc26
  • 6,363
  • 6
  • 46
  • 75
14
votes
1 answer

Using django-storages and the s3boto backend, How do I add caching info to request headers for an image so browser will cache image?

I am using the s3boto backend, not the s3 backend. In the django-storages docs it says to specify the AWS_HEADERS variable on your settings.py file: AWS_HEADERS (optional) If you’d like to set headers sent with each file of the storage: # see…
teewuane
  • 5,524
  • 5
  • 37
  • 43
14
votes
1 answer

django aws s3 image resize on upload and access to various resized image

I would like to be able resize my uploaded image to various size categories: original medium (500kb) small (200kb) And save it to AWS S3. And later be able to access it. One strategy is to save it in filename_small.jpg, filename_medium.jpg, have a…
Axil
  • 3,606
  • 10
  • 62
  • 136
14
votes
2 answers

Django AWS S3 using Boto with Compressor fails to compress UncompressableFileError

Following this guide, and these [1] [2] posts, I have tried to setup static storage on AWS S3 using django-storages Boto. When executing collectstatic, the command succesfully collects at the STATIC_ROOT. However, the files are not uploaded to S3…
Tui Popenoe
  • 2,098
  • 2
  • 23
  • 44
13
votes
5 answers

How do you set "Content-Type" when saving to S3 using django-storages with S3boto backend?

I am using django-storages with s3boto as a backend. I have one bucket with two folders - one for static and one for media. I achieve this using django-s3-folder-storage. As well as saving to S3 using a model, I also want to implement an…
awidgery
  • 1,896
  • 1
  • 22
  • 36
1
2 3
20 21