from django import forms from datetime import datetime from .models import Post, CustomUser from django.forms import ModelForm, ValidationError from taggit.forms import * class PostForm(forms.ModelForm): class Meta: model = Post fields = ('title', 'text', 'published_date','tags') class NewTagForm(forms.ModelForm): tags = TagField() class Meta: model = CustomUser fields = ['tags']