Django表单和html表单有什么区别 [英] what is the difference between Django form and html form

查看:107
本文介绍了Django表单和html表单有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于html表单提交方法进行django项目.但是最近,我知道存在django形式.请让我知道它们之间有什么区别.

I am working my django projects based on html form submission method . But recently, I came to know that there exist django forms. Please let me know what is the difference between them.

推荐答案

在Django中编写表单最终将产生HTML表单.Django表单可以绑定到模型,该模型随后将基于模型结构对表单进行验证,这省去了手动编写验证代码的麻烦,并且还有助于在对模型进行更改时使所有内容保持一致.

Writing a form in Django will ultimately produce a HTML form. The Django form can be bound to a model which will then apply validation to the form based on the model structure, this saves on having to manually code the validation and also helps keep everything aligned when changes are made to the model.

这篇关于Django表单和html表单有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆