from django import forms from .models import Post class PostForm(forms.ModelForm): class Meta: model = Post # fields = ['title', 'content', 'summary', 'tags', 'image'] fields = ['title', 'content', 'summary', 'tags'] widgets = { 'title': forms.TextInput(attrs={'class': 'form-control'}), 'summary': forms.Textarea(attrs={'class': 'form-control'}), 'content': forms.Textarea(attrs={'class': 'form-control', 'id': 'id_content'}), 'tags': forms.TextInput(attrs={'class': 'form-control'}), }