djangorestframework-xml
XML support for Django REST Framework
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- Low install friction with a single runtime dependency.
License · maintenance · safety
BSD (permissive) — BSD permissive license means you can use this freely in commercial and open-source projects with minimal restrictions, provided you include the license text.
last release 2020-04-12 (2315 days) · last repo commit 2023-09-18 · 87 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 533,927 downloads/mo, #6,139 on PyPI
Alternatives
Verify before relying
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',),
}- 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.
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 on this page. Verify before relying on it.
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
djangorestframework-xml on PyPI
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.
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.
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',),
}
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 the current Python release >=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedefusedxml |
| Maintenance | Dormant 2,315 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 533,927 / month, #6,139 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Internet :: WWW/HTTP |
Evidence: djangorestframework_xml-2.0.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django rest framework xml”
- djangorestframework-xmlAdds XML parsing and rendering support to Django REST Framework,…
- django-tastypiedjango-tastypie provides a REST API framework for Django that…
- spyneSpyne is a framework for building remote procedure call (RPC)…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also django-tastypie · djangorestframework · djangorestframework-csv · djangorestframework-yaml · djangorestframework-camel-case · drf-orjson-renderer · djangorestframework-role-filters · drf-extra-fields · drf-rw-serializers · defusedxml