Skip to content

fengsp/django-grpc-framework

Repository files navigation

Django gRPC Framework

image

image

image

image

image

Django gRPC framework is a toolkit for building gRPC services, inspired by djangorestframework.

Requirements

  • Python (3.6, 3.7, 3.8)
  • Django (2.2, 3.0), Django REST Framework (3.10.x, 3.11.x)
  • gRPC, gRPC tools, proto3

Installation

Add django_grpc_framework to INSTALLED_APPS setting:

Demo

Here is a quick example of using gRPC framework to build a simple model-backed service for accessing users, startup a new project:

Generate .proto file demo.proto:

Generate gRPC code:

Now edit the demo/urls.py module:

That's it, we're done!

You can now run a gRPC client to access the service: