Skip to main content

build-status-image pypi-version

YAML support for Django REST Framework

Full documentation for the project is available at http://jpadilla.github.io/django-rest-framework-yaml.

Overview

YAML support extracted as a third party package directly from the official Django REST Framework implementation. It’s built using the PyYAML package.

Requirements

  • Python (2.7, 3.3, 3.4)

  • Django (1.6, 1.7)

Installation

Install using pip

$ pip install djangorestframework-yaml

Example

REST_FRAMEWORK = {
    'DEFAULT_PARSER_CLASSES': (
        'rest_framework_yaml.parsers.YAMLParser',
    ),
    'DEFAULT_RENDERER_CLASSES': (
        'rest_framework_yaml.renderers.YAMLRenderer',
    ),
}

You can also set the renderer and parser used for an individual view, or viewset, using the APIView class based views.

from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_yaml.parsers import YAMLParser
from rest_framework_yaml.renderers import YAMLRenderer

class ExampleView(APIView):
    """
    A view that can accept POST requests with YAML content.
    """
    parser_classes = (YAMLParser,)
    renderer_classes = (YAMLRenderer,)

    def post(self, request, format=None):
        return Response({'received data': request.DATA})

Documentation & Support

Full documentation for the project is available at http://jpadilla.github.io/django-rest-framework-yaml.

You may also want to follow the author on Twitter.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangorestframework-yaml-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

djangorestframework_yaml-1.0.0-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file djangorestframework-yaml-1.0.0.tar.gz.

File metadata

File hashes

Hashes for djangorestframework-yaml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e4bba1287616f28777aa8b312f5bae208c4954b802c4e832fbefa3482f01ac91
MD5 4cff67a6428b915741b09d10fd56f92b
BLAKE2b-256 ceebeec45de9e91a9e3cd8e4353898b276e99d8009634cc1f4576cefb23ebafc

See more details on using hashes here.

File details

Details for the file djangorestframework_yaml-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for djangorestframework_yaml-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb5d4d5e4f92fda91aa5a547a7d639d14fc23bda84404574aad13fc49e00f6f8
MD5 8b1c5fc944d6876e7fec259eb584f18b
BLAKE2b-256 8a73987b9d3050264bae98bf22520e8e206e8207a5c213e877eaef31df199bcd

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

This release

1.0.0 This release

2 files

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page