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://codecov.io/gh/alorence/django-modern-rpc/branch/master/graph/badge.svg https://readthedocs.org/projects/django-modern-rpc/badge/?version=latest https://badge.fury.io/py/django-modern-rpc.svg https://img.shields.io/badge/demo-online-brightgreen.svg

Description

django-modern-rpc is a free, lightweight RPC server for Django projects. The library is available on PyPi.

  • XML-RPC and JSON-RPC 2.0 support. Please note that JSON-RPC 1.0 is not supported.

  • Python 2.7, 3.3, 3.4, 3.5 and 3.6

  • Django 1.8, 1.9, 1.10 and 1.11

  • HTTP Basic Auth support

  • Custom authentication support

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

  • High-level error handling 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. Install the library using pip:

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

INSTALLED_APPS = [
    #...
    'modernrpc',
    #...
]
  1. Declare an entry point, a view generating correct RPC responses to incoming requests:

# 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 provide 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_METHODS_MODULES = [
    'rpc_app.rpc_methods'
]

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))
5

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.

Source Distribution

django-modern-rpc-0.5.1.tar.gz (21.4 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.5.1-py2.py3-none-any.whl (26.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-modern-rpc-0.5.1.tar.gz
Algorithm Hash digest
SHA256 63cd11aaf61e67d68e5e59febbbc98b3f955b6506eb7cbed8970701b022b69fb
MD5 d1a1bbada143180809702ad02c911cdd
BLAKE2b-256 fe1e3602553e6f04e8fc10e03f4b6c94c05e908346b558090f2330330d0ddc60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_modern_rpc-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b9e2960d2a283a30d5aafab9bf5939501167359ac936db1583e5b40aeba6fa36
MD5 dc0b174581faebc0bae5cbbd3f2da25f
BLAKE2b-256 6eb888731774e0b692edaea5d66bb55b5978ed54a601a4499de1e22e61c99c31

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

This release

0.5.1 This release

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

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