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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 2Python 3

File details

Details for the file DjangoQiniu-0.0.1.tar.gz.

File metadata

  • Download URL: DjangoQiniu-0.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for DjangoQiniu-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c3b586fad1e6c4b3da178eb3e34d7f9d172de6fa1fbb97261aaad8dc77aab549
MD5 870ee2d70c55443d76768e8eeced48e2
BLAKE2b-256 82a0f6d4facb2a8fe978d95f10efba954cb3c666012555b3e9be57188795ace9

See more details on using hashes here.

File details

Details for the file DjangoQiniu-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for DjangoQiniu-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 12afbe334595e9643706239ede84750e48a52e16c4c87f88bd586ccdedca8b03
MD5 50c5e07ca0ab59745726fcf1335ab2da
BLAKE2b-256 99655a4c1daf5343de8cfff3465c589c4280348630391da67fed6691a45bc24f

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