django rest框架的tus(tus.io)库
sewan-drf-tus的Python项目详细描述
django rest框架的tus(tus.io)库
文档
完整的文档位于https://drf-tus.readthedocs.io。
快速启动
安装drf tus:
pip install drf-tus
将其添加到您的INSTALLED_APPS:
INSTALLED_APPS=(...'rest_framework_tus',...)
将中间件添加到MIDDLEWARE(对于django<;1.10,MIDDLEWARE_CLASSES)
MIDDLEWARE=(...'rest_framework_tus.middleware.TusMiddleware',...)
添加drf tus的url模式:
urlpatterns=[...url(r'^',include('rest_framework_tus.urls',namespace='rest_framework_tus')),...]
功能
此库实现以下TUS API v1.0.0协议:
- 核心协议(http://tus.io/protocols/resumable-upload.html#core-protocol)
- 创建协议(http://tus.io/protocols/resumable-upload.html#creation)
- 过期协议(http://tus.io/protocols/resumable-upload.html#expiration)
- 校验和协议(http://tus.io/protocols/resumable-upload.html#checksum)
- 终止协议(http://tus.io/protocols/resumable-upload.html#termination)
运行测试
代码真的有用吗?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
历史记录
1.1(2017-08-28) 1.2(2018-01-04) +++++++++++++++++
- 从drf tus分叉
- 支持Django 1.11
- 不完整上载块的错误修复