Skip to main content

django-modern-rpc

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 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
  1. 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_METHODS_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.

Metadata

Release files for django-modern-rpc 0.4.2

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 0.4.2
File Size Uploaded
django-modern-rpc-0.4.2.tar.gz 18.5 kB Details

Built distribution (wheel)

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

Total release size: 41.4 kB

Release files / django-modern-rpc-0.4.2.tar.gz

Download URL django-modern-rpc-0.4.2.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
836cbd2aa328091afcd44a04a33ec98f3c1ebf0342f3bca1b2e62018ff4833b9
BLAKE2b-256 checksum
How to use checksums
18fd0e508a984febcb068fa29b7fee5d30652d9d7c56df7136d002f7cc38c77c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_modern_rpc-0.4.2-py2.py3-none-any.whl

Download URL django_modern_rpc-0.4.2-py2.py3-none-any.whl
Size 22.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3f84e4b60ffcaf48ae1e51a9673e1208f3e766d2eb81efbb6b95d28409031b5b
BLAKE2b-256 checksum
How to use checksums
e1d7dc130839c995090c08bd0ab4e6f8b1ebb03b644a502bb5ff67c4c1680144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.1.0

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

This release

0.4.2 This release

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