semvec/pypi-packages huggingface dataset:
dj-image-uploader-widget 0.4.9
Django OSS Image Upload Widget with Customizable Configuration
License: MIT

# Django Image Uploader Widget

## 安装

```bash
pip install dj-image-uploader-widget
```

## 配置

```python
# settings.py
DJ_IMAGE_UPLOADER_OSS_CONFIG = {
    'ACCESS_KEY_ID': 'your_aliyun_key',
    'ACCESS_KEY_SECRET': 'your_aliyun_secret',
    'ENDPOINT': 'oss-cn-beijing.aliyuncs.com',
    'BUCKET_NAME': 'your-bucket-name',
    'BASE_PATH': 'user-uploads/'  # 定义你的上传路径, 可选
}

INSTALLED_APPS = [
    ...
    'dj_image_uploader_widget',
]

# urls.py
from dj_image_uploader_widget import views as upload_views

urlpatterns = [
    ...
    path('upload-to-oss/', upload_views.upload_view, name='image_upload'),
]
```

## 使用示例

```python
# models.py
from django.db import models
from dj_image_uploader_widget.fields import ImageUploaderField

class Article(models.Model):
    cover = ImageUploaderField(
        upload_url='/upload-to-oss/',  # 对应你的上传路径
        verbose_name="文章封面"
    )
```