简体   繁体   English

从 Python 发送到 JS 数据并返回响应

[英]Sending to JS data from Python and getting response back

so I am trying to send JS data, to be more specific, images responses Python file has collected, I need from python to send these images to JS and JS does a thing, (which I'll be coding) and sends the final result back to Python, how possible is that?所以我试图发送 JS 数据,更具体地说,图像响应 Python 文件已收集,我需要从 python 将这些图像发送到 JS 和 JS 做一件事,(我将编码)并发送最终结果回到 Python,这怎么可能? I have 0 idea of doing that, looking forward for help, :cheers:我有 0 这样做的想法,期待帮助,:干杯:

You can use API for the process.您可以在该过程中使用 API。 Post request & get request and so on.发布请求和获取请求等。 Also in Django you can deal with this process.同样在 Django 中,您可以处理这个过程。 Send variables from views.py and from template you can use them.从 views.py 和模板发送变量,您可以使用它们。 There is similar question: Django Template Variables and Javascript有类似的问题: Django Template Variables and Javascript

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

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