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


Download files

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

Source Distribution

DjangoQiniu-0.0.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

DjangoQiniu-0.0.1-py2.py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 2 Python 3

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