Skip to main content
https://travis-ci.org/alorence/django-modern-rpc.svg?branch=master https://coveralls.io/repos/github/alorence/django-modern-rpc/badge.svg?branch=master https://readthedocs.org/projects/django-modern-rpc/badge/?version=latest

Information

django-modern-rpc is a free, lightweight RPC server for Django projects. It supports JSON-RPC and XML-RPC requests under python 2.7, 3.3, 3.4, 3.5 and Django 1.8, 1.9 and 1.10.

Features

The project is under active development, so all the features are not yet implemented. The list of available features is:

  • XML-RPC & JSON-RPC support

  • Usual errors are correctly reported to user according to the standard

  • Multi-entry point, with specific methods and protocol attached

  • Supported system methods:

    • system.listMethods()

    • system.methodSignature()

Features planned to implement

  • System introspection methods (methodHelp(), etc.)

  • Multi-call

Installation

To install django-modern-rpc, simply use pip:

pip install django-modern-rpc

Quick start

Decorate the methods you want to make reachable from RPC call:

# In myproject/rpc_app/rpc_methods.py
from modernrpc.core import rpc_method

@rpc_method()
def add(a, b):
    return a + b

and make sure these functions are imported at Django startup. A simple way to do that is to import them in your app’s module:

# In myproject/rpc_app/__init__.py
from rpc_app.rpc_methods import add

Now, you have to declare an entry point. This is a standard Django view which will automatically route the request to the right handler (for JSON-RPC or XML-RPC call) and call the method on the server.

# In myproject/rpc_app/urls.py
from django.conf.urls import url

from modernrpc.views import RPCEntryPoint

urlpatterns = [
    url(r'^rpc/', RPCEntryPoint.as_view(), name="rpc_entry_point"),
]

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

try:
    # Python 3
    import xmlrpc.client as xmlrpc_module
except ImportError:
    # Python 2
    import xmlrpclib as xmlrpc_module

client = xmlrpc_module.ServerProxy('http://127.0.0.1:8000/all-rpc/')
print(client.add(2, 3))

# Returns: 5

Download files

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

Source Distribution

django-modern-rpc-0.2.3.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_modern_rpc-0.2.3-py2.py3-none-any.whl (16.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-modern-rpc-0.2.3.tar.gz.

File metadata

File hashes

Hashes for django-modern-rpc-0.2.3.tar.gz
Algorithm Hash digest
SHA256 fd5d344271304263bb4af7d4937ccbaf22a675749cd453988edd436acf93b693
MD5 d9b226d7768d15ff9c393d3140ae7878
BLAKE2b-256 d7014f1df1a36d5d047b76c29d61f159b6ef6a6f48d75ba7ba7ba2dbefc8eb61

See more details on using hashes here.

File details

Details for the file django_modern_rpc-0.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_modern_rpc-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 76d7dc87006f0d3279fe45368f4edd00b82bc89c221df25501754dcf3861e05e
MD5 e6994ee28387f1efd316ef9933e76c3c
BLAKE2b-256 65f060badce2b001cdf974ba63bc4c53720be44d85d946993532e1a83a1d70cf

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.0

2 files

2.0.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

1.0.0a4

2 files

1.0.0a3

2 files

1.0.0a2

2 files

1.0.0a1

2 files

0.12.1

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

This release

0.2.3 This release

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

3 files

0.1.0

2 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