django-json-rpcA simple JSON-RPC implementation for Django | |
Download |
django-json-rpc Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Samuel Sutch
- Publisher web site:
- http://github.com/samuraisam/
django-json-rpc Tags
django-json-rpc Description
A simple JSON-RPC implementation for Django django-json-rpc is a simple reference JSON-RPC implementation for Django edit.The basic API: ### myproj/myapp/views.py from jsonrpc import jsonrpc_method @jsonrpc_method('myapp.sayHello') def whats_the_time(request, name='Lester'): return "Hello %s" % name @jsonrpc_method('myapp.gimmeThat', authenticated=True) def something_special(request, secret_data): return {'sauce': } ### myproj/urls.py from jsonrpc import jsonrpc_site import myproj.myapp.views # you must import the views that need connected urls += patterns('', (r'^json/', jsonrpc_site.dispatch))To test your service: >>> from jsonrpc.proxy import ServiceProxy >>> s = ServiceProxy('http://localhost:8080/json/') >>> s.myapp.sayHello('Sam') {u'error': None, u'id': u'jsonrpc', u'result': u'Hello Sam'} >>> s.myapp.gimmeThat('username', 'password', 'test data') {u'error': None, u'id': u'jsonrpc', u'result': {u'sauce': }} Here are some key features of "django-json-rpc": · Simple, pythonic API · Support for Django authentication · Mostly supports JSON-RPC 1.1 spec · Proxy to test your JSON Service Requirements: · Django · Python
django-json-rpc Related Software