简体   繁体   English

让xml-rpc和django一起工作的最佳方法

[英]Best way to get xml-rpc and django working together

I have worked with Django for a while but I am new to xml-rpc. 我曾与Django合作过一段时间,但我是xml-rpc的新手。 I have two Django servers running and the first needs to call functions from some modules of second server. 我有两个Django服务器正在运行,第一个需要从第二个服务器的某些模块调用函数。 I find xml-rpc easiest way to do so but don't want to run a separate server for this only. 我发现xml-rpc最简单的方法,但不想为此运行单独的服务器。

What options do I have? 我有什么选择? Can I run Django's web-server and xml-rpc server with a single manage runserver command ? 我可以使用单个manage runserver命令运行Django的web服务器和xml-rpc服务器吗?

很容易 - 我们使用http://code.djangoproject.com/wiki/XML-RPC将xml-rpc服务器添加到我们的django服务器中。

You may also consider David Fisher's rpc4django which supports both XMLRPC and JSONRPC within a single package. 您也可以考虑David Fisher的rpc4django ,它在单个包中支持XMLRPC和JSONRPC。 Features include: 功能包括:

  • Detects request type (JSONRPC or XMLRPC) based on content 根据内容检测请求类型(JSONRPC或XMLRPC)
  • Easy identification of RPC methods via a decorator 通过装饰器轻松识别RPC方法
  • Pure python and requires no external modules except Django 纯Python,除Django外不需要任何外部模块
  • Customizable RPC method documentation including reST 可定制的RPC方法文档,包括reST
  • Supports XMLRPC and JSONRPC introspection 支持XMLRPC和JSONRPC内省
  • Supports method signatures (unlike SimpleXMLRPCServer) 支持方法签名(与SimpleXMLRPCServer不同)
  • Easy installation and integration with existing Django projects 易于安装并与现有Django项目集成
  • Ties in with Django's authentication and authorization 与Django的身份验证和授权联系

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM