A python library that implements a thrift parser into Django to use it's models and controllers to implement RPC/HTTP services.
Project description
Manifold is a Django application designed by ACV Auctions that allows for easy creation and serving of an RPC server through a WSGI interface using Gunicorn Thrift. Manifold uses Apache Thrift to standardize message transmission.
It allows the Django project to define the Thrift file location and service to be defined in the settings file, which is shown below.
# Thrift Configurations
MANIFOLD = {
'default': {
# Path to Thrift file, either absolute or relative
'file': os.path.join(BASE_DIR, 'path/to/service.thrift'),
'service': 'MyServiceName'
}
}
With these settings, you can do a few things. Define Python functions to handle RPC calls, load the Thrift in memory as a Python module, and serve an RPC WSGI server in both development and production.
Credits and Maintenance
Manifold is built using Django and Thriftpy, and is maintained by ACV Auctions.
Thrift Guide
For an introduction and in-depth description of Thrift, we recommend following Thrift: The Missing Guide.
Quickstart
Add manifold to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ # ... 'manifold', ]
Define your Thrift configuration like this:
# Thrift Configurations MANIFOLD = { 'default': { # Path to Thrift file, either absolute or relative 'file': os.path.join(BASE_DIR, 'path/to/service.thrift'), 'service': 'MyServiceName' } }
Run the server. You can either use the manage.py command:
python manage.py runrpcserver
or you can use gunicorn_thrift to serve it in production as a worker pool.
gunicorn_thrift manifold.rpc:app -b 0.0.0.0:9090
Usage Guide
View the wiki for usage guides.
Contributing Guide
This project is developed and maintained by ACV Auctions. We are always open to outside contributers helping to making Manifold better. To contribute, please fork this repository, make your changes, and create a Pull Request to merge your forked branch into the main master branch.
License
Manifold is Apache 2.0 Licensed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for django_manifold-1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b0724829849f0116d840b8838604b4156e7fe27ccb4f9fb02714de6e5fa6fb3 |
|
MD5 | b0c6be1e1613a76b43b493fbda4a7430 |
|
BLAKE2b-256 | 406b6efe2a1fbe2b5ed3ad2aa6c660541caf93d5f9756b721674ab0a500e7f9b |