--- id: djangorestframework-xml version: "2.0.0" license: BSD license_treatment: permissive maintenance: dormant --- # djangorestframework-xml — XML support for Django REST Framework License: permissive · Maintenance: dormant · Downloads: 533.9K/mo ## What it is and what it does djangorestframework-xml is a third-party package that extends Django REST Framework with XML content-type support. It provides XMLParser and XMLRenderer classes that allow your REST API endpoints to accept XML request bodies and return XML responses, integrated directly into Django REST Framework's serialization pipeline. The package uses defusedxml under the hood to guard against XML security vulnerabilities. The XML output format is not formally specified—it's a simple ad-hoc representation of your serialized data. If you need strict control over XML structure, namespaces, or schema compliance, you'll need to write custom XML parsers and renderers. The package is stable and permissively licensed, but dormant since 2020, so you should verify it works with your current Django and DRF versions before adopting it. Use it for: - Add XML endpoint support to an existing Django REST Framework API that primarily serves JSON but needs to support legacy XML-consuming clients. - Parse incoming XML payloads in API requests when clients cannot send JSON. - Expose API data in both JSON and XML formats by configuring different renderers per view or globally. - Migrate from an older XML-based API to Django REST Framework while maintaining XML compatibility during a transition period. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds XML parsing and rendering support to Django REST Framework, allowing APIs to accept and return XML-formatted data alongside the framework's standard JSON handling. Yes, if you need XML support in Django REST Framework and can verify compatibility with your current Django and DRF versions. The low install friction, permissive license, and lack of known vulnerabilities make it a reasonable choice. However, the dormant maintenance status (last release 2020-04-12) means you should test thoroughly in your environment and be prepared to fork or write custom XML handling if issues arise with newer Django or DRF releases. ## Install pip install djangorestframework-xml uv add djangorestframework-xml poetry add djangorestframework-xml ## Installing djangorestframework-xml Before you install: Low install friction with a single runtime dependency. The package is dormant—last release was 2020-04-12, with no commits since 2023-09-18. It remains marked Production/Stable and supports current Python versions, but you should verify compatibility with your specific Django and Django REST Framework versions before relying on it. License in practice: BSD permissive license means you can use this freely in commercial and open-source projects with minimal restrictions, provided you include the license text. Quickstart: pip install djangorestframework-xml # In Django settings.py REST_FRAMEWORK = { 'DEFAULT_PARSER_CLASSES': ('rest_framework_xml.parsers.XMLParser',), 'DEFAULT_RENDERER_CLASSES': ('rest_framework_xml.renderers.XMLRenderer',), } Requires Python 3.5+, Django 2.2+, and Django REST Framework 3.11+. The XML output format is ad-hoc and not formally specified; custom parsers/renderers may be needed for specific XML requirements. Verify before relying: - Compatibility with Django and Django REST Framework versions released after 2020-04-12. - Whether the ad-hoc XML format meets your specific XML schema or validation requirements. - Current status of defusedxml dependency and any security updates it may require. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 533.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django rest framework xml, xml parser renderer django, rest api xml support, django xml serialization, xml content type drf, xml-serialization, django-extension [View on SkillFed](https://skillfed.io/packages/djangorestframework-xml) · [View on PyPI](https://pypi.org/project/djangorestframework-xml/)