Closed. This question does not meet This question does not meet Stack Overflow guidelines . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago. Improve this question

I need to create an API in Django but unfortunately communication must be based on protobuf.

What worries me most are quite complicated data models. If I'm not mistaken definitions in models.py must be duplicated in .proto files and handling requests will require lots of 'conversions' between Django ORM and proto messages. Developing and maintaining can be very uncomfortable - minor models edits will require to edit .proto and requests.

So I dream of some framework which will do the magic in background by itself. It could give excessive set of methods, but its biggest advantage would be automation f.e. creating .proto definitions based on models.py

Unluckily three days of searching for a solution have not given expected results. So I need to prepare an 'emergency' plan.

At first I thought about django-piston and its emitters but the project is abandoned. So maybe Tastypie and its serialization? But I'm not sure if I can handle it for protobuf by my own. I'll make some experiments with cprotobuf package, but any hints and solution will be much appreciated.

Are Tastypie and cprotobuf the easiest solution or maybe there are some helpers which will save me effort and nerves?