Version: | 0.1.0 |
---|---|
Source: | https://bitbucket.org/maykinmedia/djangorestframework_hal |
Keywords: | <keywords> |
PythonVersion: | 3.6 |
HAL support for Django REST framework
Contents
- Python 3.6 or above
- setuptools 30.3.0 or above
- Django 1.11 or above
- Django REST Framework supporting the version of Django you are using
pip install djangorestframework_hal
Add the render and parser to your django settings file.
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'djangorestframework_hal.renderers.HalJSONRenderer',
# Any other renders
),
'DEFAULT_PARSER_CLASSES': (
'djangorestframework_hal.parsers.HalJSONParser',
# Any other parsers
),
}
By default the package uses rest_framework.renderers.JSONRenderer. If you want to use another renderer , you must specify it in your django settings file.
HAL_JSON = {
'RENDERER_CLASS': 'djangorestframework_camel_case.render.CamelCaseJSONRenderer',
}
python runtest tests.tests