Skip to main content

django-modern-rpc

Tests Documentation Status Downloads Link to demo

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, 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
Django 4.2 🟢 🟢 🟢 🔴 🔴
Django 5.0 🟢 🟢 🟢 🔴 🔴
Django 5.1 🟢 🟢 🟢 🟢 🔴
Django 5.2 🟢 🟢 🟢 🟢 🟢
Django 6.0 🔴 🔴 🟢 🟢 🟢

To enforce security, defusedxml will be installed as a dependency.

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 mypy 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

Sonar Coverage Sonar Quality Gate Sonar Tech Debt Sonar Violations

Codacy

Codacy Coverage Codacy Grade

Coveralls

Coveralls

Metadata

Release files for django-modern-rpc 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-modern-rpc 2.1.0
File Size Uploaded
django_modern_rpc-2.1.0.tar.gz 30.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-modern-rpc 2.1.0
File Interpreter ABI Platform
django_modern_rpc-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.4 kB

Release files / django_modern_rpc-2.1.0.tar.gz

Download URL django_modern_rpc-2.1.0.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9809fc634d7489fc9a4fbb4bb7ac3d3c2616ed6741437a2040053c6c95718536
BLAKE2b-256 checksum
How to use checksums
b6c757a3950a031bab10e82319fde3e153090427d2870f419828da877ff6e7bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.1.0-py3-none-any.whl

Download URL django_modern_rpc-2.1.0-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2ae474712d54317240450031d8d639402f1acf57796d721c032b76cbbd388d7
BLAKE2b-256 checksum
How to use checksums
7b21cb8c1367b381f99b08537057723e1cb951bbf9845d0ddf4112d88d9a9c0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.12.1

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

3 release files

0.1.0

2 release files

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