Skip to main content

A simple Django storage backend for aliyun oss2.

Project description

# Django Aliyun OSS2 Storage

### Django storage for [阿里云 OSS2](

## Install

pip install django-aliyun-oss2-storage

## Configurations

Django Aliyun OSS2 Storage 需要以下几个配置才能正常工作。这些配置通过可以环境变量或 来设置。环境变量的优先级要高于 。BUCKET_NAME`是Bucket的名字,如果该bucket不存在,程序会自动创建。`BUCKET_ACL_TYPE`用于设置Bucket的权限,可以设置为`private, public-read`和 `public-read-write

`python ACCESS_KEY_ID = "40ZhE1HyuWdllpMh" ACCESS_KEY_SECRET = "KbxtlKSvKyuyuymTiQvrxhsYFMguXy" END_POINT = "" BUCKET_NAME = "XXXX" BUCKET_ACL_TYPE = "private" # private, public-read, public-read-write `

## Usage


`python # mediafile将自动上传 DEFAULT_FILE_STORAGE = 'aliyun_oss2_storage.backends.AliyunMediaStorage' # staticfile将自动上传 STATICFILES_STORAGE = 'aliyun_oss2_storage.backends.AliyunStaticStorage' `

## License


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

django-aliyun-oss2-storage-0.1.5.tar.gz (5.4 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page