Skip to main content

qiniu file(image) upload helper utils

Project description

qiniu file(image) upload helper utils for Django

Requirements

those packages will auto install when install django_qiniu.

Install

pip install django-qiniu

Config

  1. add account_helper.middleware.CurrentUserMiddleware in MIDDLEWARE_CLASSES

  2. set qiniu config follow qiniu-storage document Configurations.

  3. edit settings.py.

DEFAULT_FILE_STORAGE = 'django_qiniu.backends.QiniuStorage'

QINIU_PREVIEW_EXPIRE = 300         # 300 seconds,default is 3600 if not set

How to use

edit your models file.

from django_qiniu.utils import user_upload_dir


# ...fields definition...

pic_00 = models.ImageField('picture 00', upload_to=user_upload_dir, blank=True)

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

django-qiniu-0.1.3.tar.gz (2.1 kB view hashes)

Uploaded Source

Supported by

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