What is RPC¶
RPC is an acronym for “Remote Procedure Call”. It is a client-server protocol allowing a program (a desktop software, a webserver, etc.) to execute a function on another machine, using HTTP messages as transport for requests and responses.
What is django-modern-rpc¶
This library can be used to implement a XML-RPC / JSON-RPC server as part of your Django project. It provide a simple and pythonic API to expose a set of global functions to the outside world.
- Python 2.7, 3.3, 3.4, 3.5 or 3.6
- Django 1.8 to 1.11
- By default, no additional dependency is required
- Optionally, you may need to install
docutilsto support rich-text in your methods documentation.
The library supports both XML-RPC and JSON-RPC 2.0 protocols. Please note that JSON-RPC 1.0 is not supported.
Content-Type is used to determine how incoming RPC call will be interpreted.
Restrict access to your RPC methods by configuring one or more predicates. They are executed before remote procedure to determine if client is allowed to run it. In addition, a set of pre-defined decorators can be used to control access based on HTTP Basic auth.
Internally, django-modern-rpc use exceptions to track errors. This help to return a correct error response to clients as well as tracking error on server side.
- Multiple entry-points
- You can configure your project to have as many RPC entry point as you want. This allows to provide different RPC methods depending on the URL used to expose them.
- Auto-generated documentation
- Provide a view and a default template to display a list of all available RPC methods on the server and the corresponding documentation, based on methods docstring.
- System introspection methods
- Common system methods such as
system.methodHelp()are provided to both JSON-RPC and XML-RPC clients. In adition,
system.multicall()is provided to XML-RPC client only to allow launching multiple methods in a single RPC call. JSON-RPC client doesn’t need such a method since the protocol itself define how client can use batch requests to call multiple RPC methods at once.
Learn how to install and configure django-modern-rpc in one minute: read the Quick-start guide.
- Quick-start guide
- Standard configuration
- Write and register remote procedures
- Entry point configuration
- HTML Documentation generation
- Error handling and logging system
- Advanced topics
- Get involved
- Current development
- Release 0.10.0 (2017-12-06)
- Release 0.9.0 (2017-10-03)
- Release 0.8.1 (2017-10-02)
- Release 0.8.0 (2017-07-12)
- Release 0.7.1 (2017-06-24)
- Release 0.7.0 (2017-06-24)
- Release 0.6.0 (2017-05-13)
- Release 0.5.2 (2017-04-18)
- Release 0.5.1 (2017-03-25)
- Release 0.5.0 (2017-02-18)
- Release 0.4.2 (2016-11-20)
- Release 0.4.1 (2016-11-17)
- Release 0.4.0 (2016-11-17)
- Release 0.3.2 (2016-10-26)
- Release 0.3.1 (2016-10-26)
- Release 0.3.0 (2016-10-18)
- Release 0.2.3 (2016-10-13)
- Release 0.2.2 (2016-10-13)
- Release 0.2.1 (2016-10-12)
- Release 0.2.0 (2016-10-05)
- Release 0.1.0 (2016-10-02)