i want to create a simple Django(1.3) project that uses JSON-RPC. i use this implementation:
and this is my project files:
urls.py:
from django.conf.urls.defaults import patterns, include, url
from myapp.views import *
from jsonrpc import jsonrpc_site
urlpatterns = patterns('',
url(r'^json/browse/', 'jsonrpc.views.browse', name="jsonrpc_browser"),
url(r'^json/', jsonrpc_site.dispatch, name="jsonrpc_mountpoint"),
(r'^json/(?P<method>[a-zA-Z0-9.]+)$', jsonrpc_site.dispatch),
)
views.py:
from jsonrpc import jsonrpc_method
@jsonrpc_method('sayHello')
def hello(request, name='Lester'):
return "Hello %s" % name
when i test this code in JSON-RPC Browser(included with the library) it doesn't work. whe is want to add this import in the shell:
from jsonrpc.proxy import ServiceProxy
i get the response like this:
Error:
what's the problem here? it seems a simple process but it doesn't work for me.