Skip to main content

This tools for generating grpc files

Project description

# gRPC tools
This is tool for auto generating *.proto and mapping django model with protobuf.

## Requirements
- Python (2.7, 3.4, 3.5, 3.6, 3.7)
- Django (1.11, 2.0, 2.1, 2.2)

## Installation
Install using pip
pip install grpc-tls

Add 'grpc_tls' to your INSTALLED_APPS setting.

Update list apps your want migrate to protobuf:

Update proto file name:

*Note*: This name must be unique if your app run multiple *.proto file

## Usage
Generate *.proto file
python grpc_tls

All files will be generated in `grpc_dir/*`

## Example
Let's take a look at a quick example of running gRPC server.

First generate proto files by running command line above.

Then create a django command line: ``.
import grpc
from concurrent import futures
from import BaseCommand

from grpc_dir import auto_grpc_app, grpc_app_pb2_grpc

class Command(BaseCommand):
help = 'Start gRPC server'

def handle(self, *args, **options):
server = grpc.server(futures.ThreadPoolExecutor(
auto_grpc_app.AutoGRPC(), server)
print('server started on port 50051 ...')
while True:
except KeyboardInterrupt:

Start gRPC server:
python run_grpc
You can now send request at ``

## Notes
DO NOT FILES IN `grpc_dir`

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for grpc-tls, version 1.1.12
Filename, size & hash File type Python version Upload date
grpc-tls-1.1.12.tar.gz (8.2 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page