Skip to main content
Travis-CI (Continuous integration) Codacy (Code quality) Coveralls (coverage report) Codecov (coverage report) Read The Doc Pypi package info Link to online demo

Description

Django-modern-rpc provides a simple solution to implement a remote procedure call (RPC) server as part of your Django project. It supports all major Django and Python versions.

Project’s main features are:

  • Simple and pythonic API

  • Python 2.7 & 3.4+ (Python 2 users must ensure six package is installed)

  • Django 1.8+

  • XML-RPC and JSON-RPC 2.0 support (JSON-RPC 1.0 not supported)

  • HTTP Basic Auth support

  • Custom authentication support

  • Automatic protocol detection based on request’s Content-Type header

  • High-level error management based on exceptions

  • Multiple entry points, with specific methods and protocol attached

  • RPC Methods documentation generated automatically, based on docstrings

  • System introspection methods:

Quick start

  1. Use pip to install the package in your environment:

    pip install django-modern-rpc
  2. Add it to your Django applications, in settings.py:

    INSTALLED_APPS = [
        ...
        'modernrpc',
    ]
  3. Declare an entry point, a view generating correct RPC responses to incoming requests:

    # In myproject/rpc_app/urls.py
    from django.conf.urls import url
    
    from modernrpc.views import RPCEntryPoint
    
    urlpatterns = [
        url(r'^rpc/', RPCEntryPoint.as_view()),
    ]
  4. Use @rpc_method to register a global function in django-modern-rpc registry:

    # In myproject/rpc_app/rpc_methods.py
    from modernrpc.core import rpc_method
    
    @rpc_method
    def add(a, b):
        return a + b
  5. 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

django-modern-rpc-0.12.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_modern_rpc-0.12.0-py2.py3-none-any.whl (28.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-modern-rpc-0.12.0.tar.gz.

File metadata

  • Download URL: django-modern-rpc-0.12.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.7

File hashes

Hashes for django-modern-rpc-0.12.0.tar.gz
Algorithm Hash digest
SHA256 5136d334c77c753ceec41752bf2204a49af423b48895b305f68ebe3addb7806e
MD5 548859c0fa7988023432a9902d4e4626
BLAKE2b-256 96c8768ae4408ea2e7deb6fe686101ddc7e5fd1169ec8297af7d28b4ae17dfdb

See more details on using hashes here.

File details

Details for the file django_modern_rpc-0.12.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_modern_rpc-0.12.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.7

File hashes

Hashes for django_modern_rpc-0.12.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ed09943ff31583145db69f0de9cfae2ce14fb47ee2e6fbd4c6d081e0e8ecd665
MD5 d95481204745c2bb225bdadf526f8549
BLAKE2b-256 c23680b631dfc859bdc7262b8cd9a56062185704073b947bd5c7bf72df0b4178

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.0

2 files

2.0.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

1.0.0a4

2 files

1.0.0a3

2 files

1.0.0a2

2 files

1.0.0a1

2 files

0.12.1

2 files

This release

0.12.0 This release

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

3 files

0.1.0

2 files

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