Django Admin S3 私有媒体文件
当使用下面的私有媒体 django-storages 类时。当我在管理中查看上传的文件时,它不会生成 URL 查询字符串授权参数。
from django.conf import settings
from storages.backends.s3boto3 import S3Boto3Storage
class PrivateMediaRootTenantedS3Boto3Storage(S3Boto3Storage):
auto_create_bucket = True
default_acl = "private"
file_overwrite = False
custom_domain = False
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 settings
from storages.backends.s3boto3 import S3Boto3Storage
class PrivateMediaRootTenantedS3Boto3Storage(S3Boto3Storage):
auto_create_bucket = True
default_acl = "private"
file_overwrite = False
custom_domain = False
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是 django-cookiecutter 将
AWS_QUERYSTRING_AUTH
值设置为False
当 其默认值为True
。有关需要为
False
的custom_domain
变量的其他参考信息,请参阅 此问题和答案。The issue was django-cookiecutter sets the
AWS_QUERYSTRING_AUTH
value toFalse
when its default isTrue
.Additional reference about the
custom_domain
variable needing to beFalse
can be found in this question and answer.