【发布时间】:2020-11-11 20:33:48
【问题描述】:
我是 django 的新手,使用crispy-forms 来呈现表单。如何将占位符文本添加到字段中,例如“请输入您的地址”
在我看来.py
class PostCreateView(LoginRequiredMixin, CreateView):
model = Post
fields = ['name', 'address']
在models.py中
class Post(models.Model):
name = models.CharField(max_length=100, blank="true")
address = models.CharField(max_length=100, blank="true")
【问题讨论】:
-
你能分享你的html吗?
标签: django django-models django-forms django-crispy-forms