Skip to main content

Django-based REST API Framework

Project description

# Rinzler REST Framework

Django-based REST Framework

# Requires

```PHP
pip install rinzler
```

# Usage
```Python

# urls.py
from your_controller import Controller
from rinzler.core.url_assembler import UrlAssembler

assembler = UrlAssembler()

urlpatterns = [
assembler.mount('', Controller)
]


# your_controller.py

from django.http.request import HttpRequest
from django.views.generic import TemplateView

from rinzler.core.response import Response

class Controller(TemplateView):

def connect(self, app):

router = app['router']

router.get('/', self.hello_world)
return app

# end-point callbacks here:
@staticmethod
def hello_world(request: HttpRequest, app: dict(), **params: dict):
"""
Default route callback
:param request HttpRequest
:param app Rinzler's object
:param params dict url params, if present
:rtype: Response
"""
response = {
"status": True,
"data": "Hello World!"
}

return Response(response, content_type="application/json")
```


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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

rinzler-1.14.0-py2.py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page