Skip to main content

在Django后台可以使用Qiniu的插件

Project description

# Django Qiniu Plugin

Django后台插件,使得Django的`admin`系统可以完美支持七牛上传。同时,也支持`xadmin`。


---------------------------

### 使用:
1. 在项目的`settings.py`文件中,配置以下信息:
```python
# 七牛配置
QINIU_DOMAIN = '七牛域名'
QINIU_ACCESS_KEY = '七牛的access_key'
QINIU_SECRET_KEY = '七牛的secret_key'
QINIU_BUCKET_NAME = '七牛的bucket_name(也即空间)'
```

2. 在`models.py`文件中,把需要保存七牛上传文件后的地址的字段,使用`QiniuField`,如下所示:
```python
from DjangoQiniu.models import QiniuField
from django import models

class Course(models.Model):
course_name = models.CharField(max_length=100)
video_url = models.QiniuField(max_length=100,qiniu_field='video_url',btn_title=u'上传到七牛')
```
其中`QiniuField`的`qiniu_field`必须传和当前字段一样的名字。`btn_title`不传则默认为`上传文件`。

Project details


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
DjangoQiniu-0.0.1-py2.py3-none-any.whl (8.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3
DjangoQiniu-0.0.1.tar.gz (7.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page