Skip to content

maxvyaznikov/extdirectrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extdirectrpc

django-extdirectrpc is a package to make RPC bridge between ExtJS (throw Ext.Direct) and Django.

  1. Install extdirectrpc
  2. Add next lines into urls.py.
    from extdirectrpc.views import extdirect_rpc_urls
    urlpatterns += extdirect_rpc_urls()
  1. Add next line into settings.py:
    EXT_DIRECT_RPC_MOUNTPOINT = '/router/'
  1. Add next line into TEMPLATE_CONTEXT_PROCESSORS:
    'extdirectrpc.context_processors.global_vars',
  1. Add next line into template:
    <script src="{{ EXT_DIRECT_ROUTER_API_URL }}"></script>
  1. Create rpc.py in submodule with new lines for testing:
    from extdirectrpc.action import ExtDirectRPCAction as RPCAction
    
    class TestAction(RPCAction):
    
        def doEcho(self, data, request):
            return data
  1. Append to template your js filewith next line:
    Ext.direct.Manager.addProvider(EXT_DIRECT_RPC_PROVIDER);
  1. Now function doEcho available by path Remote.TestAction.doEcho

About

django-extdirectrpc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages