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=release_0.3.2 https://img.shields.io/badge/demo-online-green.svg

Description

django-modern-rpc is a free, lightweight RPC server for Django projects. The project is still under development, and its API is subject to modifications. Currently supported features are:

  • XML-RPC (as described on http://xmlrpc.scripting.com/) and JSON-RPC 2.0 (from http://www.jsonrpc.org/specification) support. Please note that JSON-RPC 1.0 is not supported.

  • Automatic protocol detection based on the request’s header Content-Type

  • Python 2.7, 3.3, 3.4 and 3.5

  • Django 1.8, 1.9 and 1.10

  • Usual error handled and reported to callers

  • Multi entry points, with specific methods and protocol attached

  • System introspection methods:

Features not yet implemented

  • Multi-call for JSON-RPC

  • Built-in support for request authentications

Quick start

  1. Install the library using pip:

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

INSTALLED_APPS = [
    #...
    'modernrpc',
    #...
]
  1. Declare an entry point, a view which will generate a correct RPC response depending on the incoming request:

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

from modernrpc.views import RPCEntryPoint

urlpatterns = [
    url(r'^rpc/', RPCEntryPoint.as_view()),
]
  1. Decorate the methods you want to make available via RPC calls:

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

@rpc_method
def add(a, b):
    return a + b
  1. Declare the list of python modules containing your RPC methods, in settings.py:

MODERNRPC_ENTRY_POINTS_MODULES = [
    'rpc_app.rpc_methods'
]

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

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

To get 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.

Source Distribution

django-modern-rpc-0.4.0.tar.gz (17.6 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.4.0-py2.py3-none-any.whl (22.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-modern-rpc-0.4.0.tar.gz
Algorithm Hash digest
SHA256 491da35d272b0a28a369f7a5c04df4d78cf16960e36f738a87d9285cbad340e3
MD5 73a0734f8aecb0b750451d2e11ef5c44
BLAKE2b-256 1d4424b17434b35abaa3516ad719f846060f9176a7afea0ad7435db31d849cfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_modern_rpc-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c38c66e8839dfe4c373c889bd2ef1c329cb0c50337d13067eea822cd669a926f
MD5 d46043ce025e7df0a40d0afdb072ced3
BLAKE2b-256 d81e403274318d354157b1e0c1eaeaffcb93af1d1e83fe919333f15ffa44a6d4

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

This release

0.4.0 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

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