Django OSS Image Upload Widget with Customizable Configuration
Project description
Django Image Uploader Widget
安装
pip install dj-image-uploader-widget
配置
# 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/', upload_views.upload_view, name='image_upload'),
]
使用示例
# models.py
from django.db import models
from dj_image_uploader_widget.fields import ImageUploadField
class Article(models.Model):
cover = ImageUploadField(
upload_url='/upload/', # 对应你的上传路径
verbose_name="文章封面"
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dj_image_uploader_widget-0.2.0.tar.gz.
File metadata
- Download URL: dj_image_uploader_widget-0.2.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
181e697ad11a59a456953221d0a2014985b48c6fa054b671393f4c1de66cbe2e
|
|
| MD5 |
5c16358fdcf93912f5630ad21e391e33
|
|
| BLAKE2b-256 |
07c3a42053a6ec07dd3a420ca618d8569cb4b3e102d4625508705521cc8df8e0
|
File details
Details for the file dj_image_uploader_widget-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dj_image_uploader_widget-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98abe1cf8f3d3310fc17700273a4d8c5e2f607900e2aaabe648f940b990d4819
|
|
| MD5 |
ff4a74a1a48b9db3920b4f2623a6bf92
|
|
| BLAKE2b-256 |
fd2d8a537567d18accafedc6559d988b311ec6095a0beafbf29f54b4edbade4a
|