djangorestframework-messagepack

Parser and renderer for MessagePack in Django Rest Framework


License
MIT
Install
pip install djangorestframework-messagepack==1.0.1

Documentation

Project

Maintenance PyPI license

Overview

MessagePack renderer and parser for Django Rest Framework to easily implement it in your application.

This package uses the new msgpack instead of the old one msgpack-python and uses the same technique for encoding data as the JSONRenderer in order to reduce friction and to be able to easily use the same code.

Install

pip install djangorestframework-messagepack

Getting started

You need to setup the renderer and parser according to the Django Rest Framework documentation.

You can read about custom renderers on this link or about custom parsers here

Your end result might be something similar to this:

REST_FRAMEWORK = {
    "DEFAULT_RENDERER_CLASSES": [
        "rest_framework_messagepack.renderers.MessagePackRenderer",
    ],
    "DEFAULT_PARSER_CLASSES": [
        "rest_framework_messagepack.parsers.MessagePackParser",
    ]
}

Changelog

1.0.0

Initial release