Skip to main content

A simple Django storage backend for aliyun oss2.

Project description

# Django Aliyun OSS2 Storage

### Django storage for [阿里云 OSS2](https://www.aliyun.com/product/oss/?spm=5176.383338.201.42.WB7sGd)

## Install

pip install django-aliyun-oss2-storage

## Configurations

Django Aliyun OSS2 Storage 需要以下几个配置才能正常工作。这些配置通过可以环境变量或 settings.py 来设置。环境变量的优先级要高于 settings.py 。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 = "oss-us-west-1.aliyuncs.com" BUCKET_NAME = "XXXX" BUCKET_ACL_TYPE = "private" # private, public-read, public-read-write `

## Usage

在 settings.py 里设置 DEFAULT_FILE_STORAGE :

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

## License

基于MIT许可证发布

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 details)

Uploaded Source

Built Distribution

django_aliyun_oss2_storage-0.1.5-py2.7.egg (9.1 kB view details)

Uploaded Egg

File details

Details for the file django-aliyun-oss2-storage-0.1.5.tar.gz.

File metadata

File hashes

Hashes for django-aliyun-oss2-storage-0.1.5.tar.gz
Algorithm Hash digest
SHA256 8de84c1ee2dea1e50937155c5f47834e44676a8b1d2e61c645e6ad255ca49d79
MD5 47021d8dab7659803149ae8d9f728936
BLAKE2b-256 cd59e22479bac1c97ba9af8b7ce6e3723cd4eea420a8715aa58ac49d631b9604

See more details on using hashes here.

File details

Details for the file django_aliyun_oss2_storage-0.1.5-py2.7.egg.

File metadata

File hashes

Hashes for django_aliyun_oss2_storage-0.1.5-py2.7.egg
Algorithm Hash digest
SHA256 71f6451a9f8d3ebb091335cc713ff4b5294553f1669ffce2d0cea8ca72a3ae90
MD5 08339397b4c481a0a0c78156a63c9f9b
BLAKE2b-256 619d206a9d36e3fe96c7a626a9daabf9040f5c27dbb92895fe4deabfc4fea59b

See more details on using hashes here.

Supported by

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