5👍
The extra parameters that are being added are there to implement Query String Authentication. This allows you to pre-sign the URL to private resources stored in S3. As long as someone has the pre-signed URL (and it hasn’t expired) they will be able to access these resources even though they are not publicly readable.
Without the extra parameters, there is no way to provide public access to these private S3 resources.
- [Django]-CSRF verification failed. Request aborted
- [Django]-Can I use an existing user as Django admin when enabling admin for the first time?
- [Django]-Django: Open uploaded file while still in memory; In the Form Clean method?
5👍
Works for me:
AWS_QUERYSTRING_AUTH = False
using this https://github.com/mstarinteractive/django-s3storage
from myapp.s3storage import S3BotoStorage
from django.contrib.staticfiles.storage import CachedFilesMixin
class CachedStaticS3BotoStorage(CachedFilesMixin, S3BotoStorage):
"""Extends S3BotoStorage to save static files with hashed filenames."""
pass
StaticRootS3BotoStorage = lambda: CachedStaticS3BotoStorage(location='static')
- [Django]-Different initial data for each form in a Django formset
- [Django]-Proper way to test Django signals
- [Django]-Unable to connect to server: PgAdmin 4
0👍
It’s weird behaviour:
Google Docs previewer will work and display a preview without the parameters, but will say no preview available if boto appends the signature.
<iframe src="{% trans "https://docs.google.com/viewer?embedded=true&url=" %}{{ document.file.url }}" width="451" height="390" style="border: none;"></iframe>
I must be missing something.
- [Django]-How to add custom field in ModelSerializer?
- [Django]-Django – Create user profile on user creation
- [Django]-Django model inheritance: Create a subclass using existing super class