Skip to main content

# 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" ALIYUN_OSS_CNAME = "" # 自定义域名,如果不需要可以不填写 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许可证发布

Metadata

Release files for django3-aliyun-oss2-storage 0.1.3

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

Source distribution (sdist)

Source distribution for django3-aliyun-oss2-storage 0.1.3
File Size Uploaded
django3-aliyun-oss2-storage-0.1.3.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django3-aliyun-oss2-storage 0.1.3
File Interpreter ABI Platform
django3_aliyun_oss2_storage-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / django3-aliyun-oss2-storage-0.1.3.tar.gz

Download URL django3-aliyun-oss2-storage-0.1.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a965c8afda11d808fc081818dd56b9a0431b72292335c96b23e78ee30e8461a2
BLAKE2b-256 checksum
How to use checksums
53c0d262a1b5b1e95a153eb62426d4d3b49855fb4e4bb4b785600c7a16a4bbd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / django3_aliyun_oss2_storage-0.1.3-py3-none-any.whl

Download URL django3_aliyun_oss2_storage-0.1.3-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31c09cdd04bb53a299ac43f6895a13dba8fbe108fb6f7be26c985be733fd7434
BLAKE2b-256 checksum
How to use checksums
3567be3de01eca386fd7485cb3b30bfdd5f6a33502fe5c8deec6c477e568347c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

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