Prerequisites
RPC4Django has been tested on Mac OS, Linux and Windows.
Installation
pip install rpc4django[reST]
Configuration
First, you need to add new url pattern to your root urls.py file. You can replace r'^RPC2$' with anything you like.
# urls.py from rpc4django.views import serve_rpc_request urlpatterns = ( # rpc4django will need to be in your Python path url(r'^RPC2$', serve_rpc_request), )Second, add RPC4Django to the list of installed applications in your settings.py.
# settings.py INSTALLED_APPS = ( 'rpc4django', )Lastly, you need to let RPC4Django know which methods to make available. RPC4Django recursively imports all the apps in INSTALLED_APPS and makes any methods importable via __init__.py with the @rpcmethod decorator available as RPC methods. You can always write your RPC methods in another module and simply import it in __init__.py.
# testapp/__init__.py from rpc4django import rpcmethod # The doc string supports reST if docutils is installed @rpcmethod(name='mynamespace.add', signature=['int', 'int', 'int']) def add(a, b): '''Adds two numbers together >>> add(1, 2) 3 ''' return a+b
Metadata
Release files for rpc4django 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rpc4django-0.6.3.tar.gz | 25.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rpc4django-0.6.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 44.6 kB
Release files / rpc4django-0.6.3.tar.gz
| Download URL | rpc4django-0.6.3.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
194a368d9d889dc357ef345b87eced95c5a43b2e528b23fc339f12318962b4d2
|
|
BLAKE2b-256 checksum How to use checksums |
97a95d280daac42d119ccbc8f3f963d0d8b9ab1bd5eef6d068c403fccf932c73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.5
|
Release files / rpc4django-0.6.3-py2.py3-none-any.whl
| Download URL | rpc4django-0.6.3-py2.py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
905b0719b6a80b1fedee867588a893746d1da52bc1199dd4df7f7ed1bd886098
|
|
BLAKE2b-256 checksum How to use checksums |
e3dbb9fd8da7f63bc42d6e5e1f734825d606936766e3df16420577b67a1b8ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.5
|