Skip to main content

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

要求

  1. 支持 Python3.4

Release files for django-storage-qcloud 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-storage-qcloud 0.2.1
File Size Uploaded
django-storage-qcloud-0.2.1.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-storage-qcloud 0.2.1
File Interpreter ABI Platform
django_storage_qcloud-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / django-storage-qcloud-0.2.1.tar.gz

Download URL django-storage-qcloud-0.2.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3e0fbdbff3fa3c2f2f54b24d30927eedebd9156121a4501b59ffc4aea448388f
BLAKE2b-256 checksum
How to use checksums
5f7978b4b839e52e2a28e0417a8a7264a6329fd41b865a68342afcbb3aae9ae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.7

Release files / django_storage_qcloud-0.2.1-py3-none-any.whl

Download URL django_storage_qcloud-0.2.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
625e5ec6b49b6508e9997c83595ac887ea27590ff6d9b9ef76c373119cec682b
BLAKE2b-256 checksum
How to use checksums
31357b3802a69f3493fc531240a1e805de2dfc4bbf3792d905aa59b434e45fe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page