[英]Passing data from React frontend to Django Backend
I have a completed react app and I have a textarea and button in it and I want the textarea text to be passed to the django backend when the button is pressed.我有一个完整的反应应用程序,其中有一个 textarea 和按钮,我希望在按下按钮时将 textarea 文本传递到 django 后端。 In my folder, I have a React UI, Django project, along with a Django app inside of that project.
在我的文件夹中,我有一个 React UI,Django 项目,以及该项目内的 Django 应用程序。 I know I have to use the django REST framework but I dont know how to pass the text from the React UI to the backend of Django.
我知道我必须使用 django REST 框架,但我不知道如何将文本从 React UI 传递到 Django 的后端。
Sounds like a job for a form, to POST to the backend.听起来像是一份表格的工作,要发布到后端。 Or, an ajax POST after an
onclick
event.或者,在
onclick
事件之后的 ajax POST。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.