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:
system.listMethods()
system.methodSignature()
system.methodHelp()
system.multicall() (XML-RPC only, using specification from https://mirrors.talideon.com/articles/multicall.html)
Features not yet implemented
Multi-call for JSON-RPC
Built-in support for request authentications
Quick start
Install the library using pip:
pip install django-modern-rpc
Add it to your Django applications, in settings.py:
INSTALLED_APPS = [
#...
'modernrpc',
#...
]
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()),
]
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
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-modern-rpc-0.4.1.tar.gz.
File metadata
- Download URL: django-modern-rpc-0.4.1.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08923b5eb86373462b00847009aac4187c145747d2fe10c8a4ae88b92389057b
|
|
| MD5 |
4c1a652d6881c5cbd6da3e713eb76e99
|
|
| BLAKE2b-256 |
452a32cfacc5fed58e4cd6d92147d346daf29854f0d1cf57164d2f3c9aae014e
|
File details
Details for the file django_modern_rpc-0.4.1-py2.py3-none-any.whl.
File metadata
- Download URL: django_modern_rpc-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ab9b123b64d2817c0c4472467c7dc177a65c591ce5e401851a3aae38039860
|
|
| MD5 |
f2377d9958000b303b8bcd9bcab58405
|
|
| BLAKE2b-256 |
d78e8c2684c8cc5ff9732c73ac573534e8c877e39510046a161bfd768cff07e8
|