Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
多个django存储器_Django_Amazon S3_Django Storage - Fatal编程技术网

多个django存储器

多个django存储器,django,amazon-s3,django-storage,Django,Amazon S3,Django Storage,我有一个django项目,其中所有静态和媒体文件都存储在s3上。相同的存储是默认存储。我为我的私人文件创建了另一个存储 protected_storage = S3BotoStorage( acl='private', bucket=settings.IMPORT_SHEETS_BUCKET, querystring_auth=True, querystring_expire=60, ) 在我的一个模型中,有一个文件字段 import_sheet = model

我有一个django项目,其中所有静态和媒体文件都存储在s3上。相同的存储是默认存储。我为我的私人文件创建了另一个存储

protected_storage = S3BotoStorage(
    acl='private',
    bucket=settings.IMPORT_SHEETS_BUCKET,
    querystring_auth=True,
    querystring_expire=60,
)
在我的一个模型中,有一个文件字段

import_sheet = models.FileField(storage=protected_storage)
当我将文件上载到此字段时,它将上载到所需的bucket。然而,当我试图从django admin访问它时,我会得到一个默认存储桶的url。想法