django-rest-framework-braces-DRF(Django REST 框架) 实用工具集锦

网友投稿 476 2022-10-28

django-rest-framework-braces-DRF(Django REST 框架) 实用工具集锦

django-rest-framework-braces-DRF(Django REST 框架) 实用工具集锦

Django Rest Framework Braces

Collection of utilities for working with DRF. Name inspired by django-braces.

Free software: MIT licenseGitHub: https://github.com/dealertrack/django-rest-framework-bracesDocumentation: https://django-rest-framework-braces.readthedocs.io.

Installing

Easiest way to install django-rest-framework-braces is by using pip:

$ pip install django-rest-framework-braces

Usage

Once installed, you can use any of the supplied utilities by simply importing them. For example:

from drf_braces.mixins import MultipleSerializersViewMixinclass MyViewSet(MultipleSerializersViewMixin, GenericViewSet): def create(self, request): serializer = self.get_serializer(serializer_class=MySerializer) ...

For full list of available utilities, please refer to the documentation.

Testing

To run the tests you need to install testing requirements first:

$ make install

Then to run tests, you can use use Makefile command:

$ make test

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:JVM基础教程第3讲:到底什么是虚拟机?
下一篇:JVM基础教程第4讲:从源代码到机器码,发生了什么?
相关文章

 发表评论

暂时没有评论,来抢沙发吧~