Skip to main content

Prerequisites

RPC4Django has been tested on Mac OS, Linux and Windows.

Installation

pip install rpc4django[reST]

Configuration

  1. 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),
    )
  2. Second, add RPC4Django to the list of installed applications in your settings.py.

    # settings.py
    
    INSTALLED_APPS = (
        'rpc4django',
    )
  3. 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)

Source distribution for rpc4django 0.6.3
File Size Uploaded
rpc4django-0.6.3.tar.gz 25.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rpc4django 0.6.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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