Skip to main content

Simple and modern JSON-RPC and XML-RPC server implementation for Django

Project description


Django-modern-rpc provides a simple solution to implement a remote procedure call (RPC) server as part of your Django project. It supports all major Django and Python versions.

Project’s main features are:

  • Simple and pythonic API
  • Python 2.7, 3.3, 3.4, 3.5 and 3.6
  • Django 1.8, 1.9, 1.10 and 1.11
  • XML-RPC and JSON-RPC 2.0 support (JSON-RPC 1.0 not supported)
  • HTTP Basic Auth support
  • Custom authentication support
  • Automatic protocol detection based on request’s Content-Type header
  • High-level error management based on exceptions
  • Multiple entry points, with specific methods and protocol attached
  • RPC Methods documentation generated automatically, based on docstrings
  • System introspection methods:

Quick start

  1. Use pip to install the package in your environment:

    pip install django-modern-rpc
  2. Add it to your Django applications, in

  3. Declare an entry point, a view generating correct RPC responses to incoming requests:

    # In myproject/rpc_app/
    from django.conf.urls import url
    from modernrpc.views import RPCEntryPoint
    urlpatterns = [
        url(r'^rpc/', RPCEntryPoint.as_view()),
  4. Use @rpc_method to register a global function in django-modern-rpc registry:

    # In myproject/rpc_app/
    from modernrpc.core import rpc_method
    def add(a, b):
        return a + b
  5. Declare the list of python modules containing your RPC methods, in


Now, you can call the method add from a client:

>>> from xmlrpc.client import ServerProxy
>>> client = ServerProxy('http://localhost:8000/rpc/')
>>> print(client.add(2, 3))

For more information, please read the full documentation.

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django_modern_rpc-0.8.0-py2.py3-none-any.whl (27.6 kB) Copy SHA256 hash SHA256 Wheel py2.py3
django-modern-rpc-0.8.0.tar.gz (22.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page