from package.proto import thing_pb2
something = thing_pb2.SomeThing(id=some_id)
something.simple_prop = 'foo'
something.message_prop.CopyFrom(msg_instance)
return HttpResponse(
protoInstance.SerializeToString(),
content_type='application/octet-stream',
)
return Response(
protoInstance.SerializeToString(),
mimetype='application/octet-stream',
)