Answer the question
In order to leave comments, you need to log in
Working with forms in Django to create posts, how to insert a link inside a post?
I started learning django, writing a website with a blog (purely for practice)
I made a form for creating a post:
class PostForm(forms.ModelForm):
class Meta:
model = Rost
fields = ['title', 'slug', 'body', 'tags']
widgets = {
'title':forms.TextInput(attrs={'class':'form-control'}),
'slug':forms.TextInput(attrs={'class':'form-control'}),
'body': forms.Textarea(attrs={'class':'form-control'}),
'tags':forms.SelectMultiple(attrs={'class':'form-control'}),
}
Answer the question
In order to leave comments, you need to log in
Something like this in the template.
https://docs.djangoproject.com/en/3.0/ref/template...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question