Skip to main content

Django OSS Image Upload Widget with Customizable Configuration

Project description

Django Image Uploader Widget

PyPI version

安装

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj_image_uploader_widget-0.3.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_image_uploader_widget-0.3.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file dj_image_uploader_widget-0.3.0.tar.gz.

File metadata

File hashes

Hashes for dj_image_uploader_widget-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ab9e8789f7aeda6d3f68f313270255eba016ad297f5fe06f5dbb9cd4cb7a987e
MD5 e9c101a45a6e6182224c2d9e4978cfa2
BLAKE2b-256 8206f9ed9579edcacb6dd005d334a35bc44d43b6ec627bc400dfcdbf3b40425e

See more details on using hashes here.

File details

Details for the file dj_image_uploader_widget-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dj_image_uploader_widget-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac540844022e64bd8958e2e950a6d52b63547904678eb724ba9ff3f8116e8408
MD5 c6c03acbccf4958df4a212958aa76126
BLAKE2b-256 c47abae1d6386af32c51318f240a32d24ebe2235dd6da687c310dc580c77ac79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page