Skip to main content

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)

Source distribution for django5-upyun-storage 1.0.4
File Size Uploaded
django5-upyun-storage-1.0.4.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django5-upyun-storage 1.0.4
File Interpreter ABI Platform
django5_upyun_storage-1.0.4-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.4 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