Skip to content

gRPC Development Patterns

Sandro Meireles edited this page Feb 22, 2021 · 9 revisions

Using some development standards can help us to implement a dockable, safe and easy to maintain solution.

Creating a new gRPC App:

To speed up the work, we can create an app using Django itself. In /rapidpro-apps/weni/

Type it:

> django-admin startapp <app_name>

A new directory should appear containing the name of the application. By default Django generates several files, which for us will not be useful, therefore, we must delete them (or rename them).

The final structure we want should look like this:

<app_name>
├── apps.py
├── grpc
│   ├── __init__.py
│   ├── <proto_name>_pb2_grpc.py
│   └── <proto_name>_pb2.py
├── __init__.py
├── serializers.py
├── services.py
├── tests.py
└── urls.py
Clone this wiki locally