简体   繁体   English

使用DJANGO消费Web服务

[英]Consume web service with DJANGO

I have a django application to show some data from my database (ORACLE), but now I need to show some data from a web service. 我有一个django应用程序来显示数据库(ORACLE)中的一些数据,但是现在我需要显示Web服务中的一些数据。

I need to build a form based in the request of the web service, and show the response of the web service. 我需要根据Web服务的请求构建一个表单,并显示Web服务的响应。

I googling to expose my app as a web service and send and retrieve XML data. 我在搜索中将我的应用程序公开为Web服务,并发送和检索XML数据。

But I am very confused and I don't know where to start or which django package to use(PyXML,DJANGO REST). 但是我很困惑,我不知道从哪里开始或要使用哪个django包(PyXML,DJANGO REST)。

I am not sure if I need to build a web API or I can consume the web service without the web api. 我不确定是否需要构建Web API还是可以在没有Web API的情况下使用Web服务。

Can someone give some advices to achieve this task. 有人可以提供一些建议以完成此任务吗?

You don't need to build a web API if all you want to do is consume someone else's API. 如果您只想使用其他人的API,则无需构建Web API。 Just retrieve the data - with something like requests - and use it in your Django app. 只需检索数据(带有类似requests ),然后在Django应用中使用它即可。

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

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