A django app for Tencent Cloud Object Storage. 腾讯云对象存储(COS)服务 for Django。
Project description
Django TencentCOS Storage
腾讯云对象存储(COS)服务 for Django。
环境要求
Python: >=3.7, <4
Django: >=2.2, <3.3
安装
pip install django-tencentcos-storage
基本使用
在项目的 settings.py 中设置 DEFAULT_FILE_STORAGE
:
DEFAULT_FILE_STORAGE = "tencentcos_storage.TencentCOSStorage"
此外,还需要设置腾讯云对象存储服务相关的必要信息:
TENCENTCOS_STORAGE = {
"BUCKET": "存储桶名称",
"CONFIG": {
"Region": "地域信息",
"SecretId": "密钥 SecretId",
"SecretKey": "密钥 SecretKey",
}
}
详情可参考 腾讯云对象存储官方文档
设置
示例
TENCENTCOS_STORAGE = {
# 存储桶名称,必填
"BUCKET": "存储桶名称",
# 存储桶文件根路径,默认 '/'
"ROOT_PATH": "/",
# 腾讯云存储 Python SDK 的配置参数,详细说明请参考腾讯云官方文档
"CONFIG": {
"Region": "地域信息",
"SecretId": "密钥 SecretId",
"SecretKey": "密钥 SecretKey",
}
}
说明
BUCKET
存储桶名称,必填
ROOT_PATH
文件根路径,默认为 '/'
CONFIG
腾讯云对象存储 Python SDK 的配置参数,其中
Region
、SecretId
、SecretKey
为必填参数。关于配置参数的详细说明请参考 腾讯云对象存储 Python SDK 官方文档
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-tencentcos-storage-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8506403dd3e75b7c3384ff1e748a1b9aa65eb57534f832edff93b20f8723944 |
|
MD5 | 5c3f4f0ddd133210c95673d9a677c23b |
|
BLAKE2b-256 | b9669f0fff265be2dbecfba3c06b59b060874bbf38d313278b88e58cac29a4d3 |
Close
Hashes for django_tencentcos_storage-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1e324d68420f7f9b0057b5ab9401a4b79dfcc19eaf680d98f8f08c35f85eddb |
|
MD5 | 2bf84b0ead6cb84135717de5799edeb4 |
|
BLAKE2b-256 | d64a58cc214f02b04a75321cc13b1be7bd26e9c40d67c58c880babe47d4bd199 |