Skip to main content

Django qcloud cos storage backend

Project description

django-storage-qcloud

Django storage for qcloud's COS

介绍

django-storage-qcloud 是一个服务于腾讯云存储的 Django 自定义存储系统。

安装

  • 使用 pip 安装
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.QcloudStorage'
    • 将静态文件存放到云 STATICFILES_STORAGE = 'django_storage.qcloud.QcloudStorage'
    • 替换 SecretId, SecretKey, Region, Bucket 的值
    QCLOUD_STORAGE_OPTION = {
        'SecretId': 'SecretId 是开发者拥有的项目身份识别 ID,用以身份认证',
        'SecretKey': 'SecretKey 是开发者拥有的项目身份密钥。',
        'Region': '域名中的地域信息',
        'Bucket': '存储桶是 COS 中用于存储数据的容器,每个对象都存储在一个存储桶中',
    }
    
  • 同步静态文件到云 python manage.py collectstatic

要求

  1. 支持 Python3.4

Project details


Release history Release notifications

This version
History Node

0.1.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_storage_qcloud-0.1.2-py3-none-any.whl (3.9 kB) Copy SHA256 hash SHA256 Wheel py3
django-storage-qcloud-0.1.2.tar.gz (2.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page