Integrates ripozo with django for fast, flexible Hypermedia, HATEOAS, and other REST apis
Project description
Integrates ripozo with django for fast, flexible Hypermedia, HATEOAS, and other REST apis.
Full django-ripozo documentation
Looking for the ripozo documentation?
Minimal App
You’ll need to instantiate the django project in the standard manner. If you aren’t sure how to do this, check out the excellent django documentation.
In your app you’ll need a resources.py file.
from ripozo import ResourceBase, apimethod
class MyResource(ResourceBase):
@apimethod(methods=['GET'])
def say_hello(cls, request):
return cls(properties=dict(hello='world'))
And in your urls.py file
from ripozo.adapters import SirenAdapter, HalAdapter
from .resources import MyResource
dispatcher = DjangoDispatcher()
dispatcher.register_resources(MyResource)
dispatcher.register_adapters(SirenAdapter, HalAdapter)
urlpatterns = dispatcher.url_patterns
And just like that you have a fully functional application.
Looking for a more extensive example? Check out an example with database interactions as well.
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 Distribution
File details
Details for the file django-ripozo-1.0.0.tar.gz
.
File metadata
- Download URL: django-ripozo-1.0.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6ca8f71ee9b856c4ec1a0b7d29b4535a7ad62dbd4dea8d44d095fc59f133b2 |
|
MD5 | babd583cb88b6591ea775c2fc23080c7 |
|
BLAKE2b-256 | 379e293ab91fb1140b5f4d369f4376ae6cbc45b690e4f4e5b6ca75bfba484f9f |