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:
system.listMethods()
system.methodSignature()
system.methodHelp()
system.multicall() (XML-RPC only, using specification from https://mirrors.talideon.com/articles/multicall.html)
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 generating a correct RPC response to 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 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
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
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.5.0.tar.gz.
File metadata
- Download URL: django-modern-rpc-0.5.0.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ee41778f109c809a49fa1db5470c006a7e53eae1bcd20cb4c89ed7a40185b31
|
|
| MD5 |
366ca17537d2aff8db7db49dca565f00
|
|
| BLAKE2b-256 |
8513d57b2414433a1f0404c7c6315e2d6a471aee06f83d3e3a4c4b28f4515274
|
File details
Details for the file django_modern_rpc-0.5.0-py2.py3-none-any.whl.
File metadata
- Download URL: django_modern_rpc-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
102c27d385c63974c4497ec062baae717a9f6fc9ead84aa5414a4d1bc8add620
|
|
| MD5 |
7493b6e8c4e83bbc53a8445fc47dbc86
|
|
| BLAKE2b-256 |
17fe2723c85689046e433c13d4bccc579006187289739b8f03e5937d083af6e3
|