Django qcloud cos storage backend
Project description
django-storage-qcloud
Django storage for qcloud's COS
介绍
django-storage-qcloud 是一个服务于腾讯云存储的 Django 自定义存储系统。
安装
- 使用 pip 安装
pip install django-storage-qcloud
或者直接从 git 安装
pip install git+https://github.com/fordguo/django-storage-qcloud.git
- 添加 requirements.txt
git+https://github.com/fordguo/django-storage-qcloud.git
- 配置 setting.py:
- 将上传文件存放到云
DEFAULT_FILE_STORAGE = 'django_storage_qcloud.storage.QcloudStorage'
- 将静态文件存放到云
STATICFILES_STORAGE = 'django_storage_qcloud.storage.QcloudStorage'
- 替换 SecretId, SecretKey, Region, Bucket 的值
QCLOUD_STORAGE_OPTION = { 'SecretId': 'SecretId 是开发者拥有的项目身份识别 ID,用以身份认证', 'SecretKey': 'SecretKey 是开发者拥有的项目身份密钥。', 'Region': '域名中的地域信息', 'Bucket': '存储桶是 COS 中用于存储数据的容器,每个对象都存储在一个存储桶中', }
- 其他配置:
- COS_URL = 'https://www.qixincha.com' # 自定义域名, 不配置将使用 COS 默认域名
- COS_FAST_CDN = False # 默认加速域名是否开启
- 将上传文件存放到云
- 同步静态文件到云
python manage.py collectstatic
要求
- 支持 Python3.4
Project details
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-storage-qcloud-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e97ca0ae617ea61b8138000d5c889eaaf06c9f7fa8447bfd9b1368a470408ba |
|
MD5 | b4ebe3b6100f260ef472b71165002cba |
|
BLAKE2b-256 | b5a7bc67359c9032801e57a9595dbddb73f01d1f1f7283ec18524c7d794a6aa2 |
Close
Hashes for django_storage_qcloud-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 814124acb8e8f193e1612a3ad42e10228313f5175e7aad783aaf52c3870f20dc |
|
MD5 | b1fc0e2936d1ff4c9b47a526ec7489c0 |
|
BLAKE2b-256 | 4ada0baedbad8e4e94f9b9780b51513f39436beddee9df591e255221ce0c02cc |