Here they say it's not supported out of the box.
您知道一种使 HTML 输入表单字段使用 WTForms 的“只读”属性的方法吗?
最佳答案
解决方案是在表单字段声明中使用render_kw
。
my_field = fields.StringField('Label', render_kw={'readonly': True})
关于python - WTForms 支持输入只读属性吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9599551/