django-modern-rpc
Embed an XML-RPC / JSON-RPC server in your Django project!
Main features
- XML-RPC and JSON-RPC 2.0 support (JSON-RPC 1.0 is NOT supported)
- Custom authentication process
- Custom error handling
- Sync and async procedures
- Multiple servers
- Customizable XML / JSON backends with builtin support for orjson, msgspec, ujson, rapidjson, lxml, etree, etc.
Requirements
The following Django / Python versions are supported, according to Django Installation FAQ
| Python ➞ | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 |
|---|---|---|---|---|---|---|
| Django 4.2 | 🟢 | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 |
| Django 5.0 | 🟢 | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 |
| Django 5.1 | 🟢 | 🟢 | 🟢 | 🟢 | 🔴 | 🔴 |
| Django 5.2 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🔴 |
| Django 6.0 | 🔴 | 🔴 | 🟢 | 🟢 | 🟢 | 🟢 |
| Django 6.1 | 🔴 | 🔴 | 🟢 | 🟢 | 🟢 | 🟢 |
To enforce security, defusedxml will be installed as a dependency, along with typing-extensions.
Quickstart
Install django-modern-rpc in your environment
pip install django-modern-rpc
Create an RpcServer instance and register your first procedure, in myapp/rpc.py
from modernrpc.server import RpcServer
server = RpcServer()
@server.register_procedure
def add(a: int, b: int) -> int:
"""Add two numbers and return the result.
:param a: First number
:param b: Second number
:return: Sum of a and b
"""
return a + b
Configure a path to allow RPC clients calling your procedures, in urls.py
from django.urls import path
from myapp.rpc import server
urlpatterns = [
# ... other url patterns
path("rpc/", server.view), # Synchronous view
# Alternatively, you can use the asynchronous view:
# path('rpc/', server.async_view),
]
The server's view is already configured with CSRF exemption and POST-only restrictions.
Code quality
The project uses nox as a task runner to launch tests suite against all supported Python / Django combinations and generate a coverage report file. Ruff is used to lint and format the codebase, and pyrefly is used to perform type checking.
All these tools are automatically run in various GitHub Actions workflows, and external tools are used to perform static code analysis and collect coverage results.
SonarQube
Codacy
Coveralls
Metadata
Release files for django-modern-rpc 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_modern_rpc-2.2.0.tar.gz | 34.3 kB | Without provenance | Details for django_modern_rpc-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_modern_rpc-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for django_modern_rpc-2.2.0-py3-none-any.whl |
Total release size: 81.4 kB
Release files / django_modern_rpc-2.2.0.tar.gz
| Download URL | django_modern_rpc-2.2.0.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a58dad9ca2313382e5e85c2333594ed28fe06aae1652c3f3ab183d4ffcaf09a
|
|
BLAKE2b-256 checksum How to use checksums |
c361d01903219adfd31f54ce8a83a48adaf52e4c4340beac681e4e108208ddbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / django_modern_rpc-2.2.0-py3-none-any.whl
| Download URL | django_modern_rpc-2.2.0-py3-none-any.whl |
|---|---|
| Size | 47.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5fea218cd0a1f118881ed9cd7033d89d083934d6dd56cfc1f667acb31eb9a06
|
|
BLAKE2b-256 checksum How to use checksums |
4a61ca86f45ac282680d2ab1d3791e17e1f824dc36e6d84a58ac91e1ddfc7c4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for django-modern-rpc 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.