Django中Form的Textarea字段
开始以为是这个样子:
- class BlogForm(forms.Form):
- title = forms.CharField(required = True)
- content = forms.Textarea()
查看文档发现是:
- from django import forms
- class BlogForm(forms.Form):
- title = forms.CharField(required = True)
- content = forms.CharField(widget=forms.Textarea)