Django view for JSend specification
Find a file
2018-04-02 17:37:06 +02:00
django_jsend [TASK] Use Django JsonResponse for better json support 2018-04-02 17:37:06 +02:00
.gitignore [TASK] Add install_requires to setup for django 2015-02-21 12:35:11 +01:00
LICENSE.txt INIT Project, setup base structure 2015-01-17 13:33:41 +01:00
README.md Update README.md 2017-09-24 10:13:21 +02:00
setup.cfg [TASK] Add setup 2015-02-21 12:02:40 +01:00
setup.py [TASK] Use Django JsonResponse for better json support 2018-04-02 17:37:06 +02:00
tests.py [TASK] Add unit testing 2015-02-21 12:02:00 +01:00

Django Jsend

Django view for sending Jsend responses.

Instalation

To install the Django library:

pip install django_jsend

Usage

from django_jsend import JsendView

class CustomJsendView(JsendView):

    def handle_request(self, request, param_id=None):
        if not param_id:
            raise Exception('Param id could not be empty')
       return {
            'some': 'date',
            'object': param_id,
       }

# urls
url(r'^custom/(?P<param_id>\w+)/$', CustomJsendView.as_view(), name='custom')