Metadata-Version: 2.1
Name: bthlabs-jsonrpc-django
Version: 1.0.0
Summary: BTHLabs JSONRPC - Django integration
Home-page: https://projects.bthlabs.pl/bthlabs-jsonrpc/
License: MIT
Author: Tomek Wójcik
Author-email: contact@bthlabs.pl
Maintainer: BTHLabs
Maintainer-email: contact@bthlabs.pl
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: bthlabs-jsonrpc-core (==1.0.0)
Requires-Dist: django (>=3.2,<5.0)
Project-URL: Documentation, https://projects.bthlabs.pl/bthlabs-jsonrpc/aiohttp/
Project-URL: Repository, https://git.bthlabs.pl/tomekwojcik/bthlabs-jsonrpc/
Description-Content-Type: text/x-rst

bthlabs-jsonrpc-django
======================

BTHLabs JSONRPC - django integration

`Docs`_ | `Source repository`_

Overview
--------

BTHLabs JSONRPC is a set of Python libraries that provide extensible framework
for adding JSONRPC interfaces to existing Python Web applications.

The *django* package provides Django integration.

Installation
------------

.. code-block:: shell

    $ pip install bthlabs_jsonrpc_django

Example
-------

.. code-block:: python

    # settings.py
    INSTALLED_APPS = [
        # ...
        'bthlabs_jsonrpc_django',
    ]

.. code-block:: python

    # settings.py
    JSONRPC_METHOD_MODULES = [
        # ...
        'your_app.rpc_methods',
    ]

.. code-block:: python

    # urls.py
    urlpatterns = [
        # ...
        path('rpc', JSONRPCView.as_view()),
    ]

.. code-block:: python

    # your_app/rpc_methods.py
    from bthlabs_jsonrpc_core import register_method

    @register_method(name='hello')
    def hello(request, who='World'):
        return f'Hello, {who}!'

Author
------

*bthlabs-jsonrpc-django* is developed by `Tomek Wójcik`_.

License
-------

*bthlabs-jsonrpc-django* is licensed under the MIT License.

.. _Docs: https://projects.bthlabs.pl/bthlabs-jsonrpc/django/
.. _Source repository: https://git.bthlabs.pl/tomekwojcik/bthlabs-jsonrpc/
.. _Tomek Wójcik: https://www.bthlabs.pl/

