/django-grpc-framework

gRPC for Django

Primary LanguagePythonApache License 2.0Apache-2.0

django-grpc-framework

https://travis-ci.org/itswcg/django-grpc-framework.svg?branch=master https://readthedocs.org/projects/django-grpc-framework/badge/?version=latest

gRPC for Django inspired by djangorestframework.

Documentation

The full documentation is at https://django-grpc-framework.readthedocs.io.

Quickstart

Install django-grpc-framework:

pip install django-grpc-framework

Add it to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'grpc_framework',
]

Create your grpc app:

python manage.py grpcstartapp <app_name>

Define your proto in <app_name>/<app_name>.proto.

Add your app to GRPC_APPS:

GRPC_APPS = [
    '<app_name>',
]

Generate protocol buffer compiler:

python manage.py grpcgenerate

Create your service in <app_name>/service.py.

Start a grpc server with your apps:

python manage.py grpcrunserver

Todo

  • support async
  • more interceptors

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox