Django5 又拍云存储
用于又拍云的 Django5 存储后端。
安装
pip install django5-upyun-storage
配置
在您的 Django settings.py INSTALLED_APPS 中添加以下设置:
INSTALLED_APPS = [
...
'django5_upyun_storage',
...
]
在您的 Django settings.py 中添加以下设置:
UPYUN_STORAGE = {
'SERVICE': '服务名称',
'USERNAME': '授权账户',
'PASSWORD': '授权密码',
'DOMAIN': '绑定域名', # 可选,如果为空,则使用又拍云的默认域名 http://yourdomain.com
}
# 设置为默认存储器
STORAGES = {
'default': {
'BACKEND': 'django5_upyun_storage.storage.UpYunStorage',
},
'staticfiles': {
'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage',
}
}
使用
from django.db import models
class YourModel(models.Model):
file = models.FileField(upload_to='uploads/')
image = models.ImageField(upload_to='images/')
特性
- 兼容 Django 5.0+
- 支持所有基本文件操作
- 处理文件删除
- 可配置的上传路径
- 支持静态文件存储
许可证
MIT 许可证
贡献
欢迎贡献!请随时提交拉取请求。
Metadata
Release files for django5-upyun-storage 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django5-upyun-storage-1.0.4.tar.gz | 5.2 kB | Without provenance | Details for django5-upyun-storage-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django5_upyun_storage-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for django5_upyun_storage-1.0.4-py3-none-any.whl |
Total release size: 10.8 kB
Release files / django5-upyun-storage-1.0.4.tar.gz
| Download URL | django5-upyun-storage-1.0.4.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90b2420938b0ced2eea60cc59d944fde431f6efd49a5fcd594b1792e10af9fef
|
|
BLAKE2b-256 checksum How to use checksums |
7d210e36bbe3bd5afc159dfab9050a5556898e1615c6e2081f045b9457126e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.0
|
Release files / django5_upyun_storage-1.0.4-py3-none-any.whl
| Download URL | django5_upyun_storage-1.0.4-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
591eef226109e1a6e5420f631f43540d520f09d7664555e2fa8244c848be9e93
|
|
BLAKE2b-256 checksum How to use checksums |
cde0e889f9008f51f62e9c8f09fe305799386f14bac47c754da4a7d6659c6007
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.0
|
Security for django5-upyun-storage 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.