从HTML获取数据,而无需使用Django表单模板 [英] get data from HTML without using django form template
本文介绍了从HTML获取数据,而无需使用Django表单模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Django中是否有一种方法可以从HTML获取数据,而无需在html中使用 django表单模板
.原因是我们是两个不同的开发人员,一个是从事前端ui设计的开发人员,另一个是django编码器.
Is there a way in Django to get the data from HTML without using django forms template
in html. The reason is we are two different Developers , one who works on Frontend ui design and the other django coder.
因此,如果他只是给我html和css文件,我将无法使用它,除非我在HTML中添加表单模板来代替他的代码.
So if he just gives me html and css files, i won't be able to just use it, unless i add form template in HTML substituting his code.
我想知道没有Django表单就可以获取`POST'数据.
i am wondering can just get the `POST' data without django forms.
推荐答案
当然,您可以使用以下方法轻松获取POST数据:
Of course you can get POST data easily by using:
def home(request):
if request.method == 'POST':
data = request.POST['variable']
其中变量
是字段名称.
这篇关于从HTML获取数据,而无需使用Django表单模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文