We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c85891 commit d704f34Copy full SHA for d704f34
home/forms.py
@@ -3,7 +3,12 @@
3
4
5
class HomeForm(forms.ModelForm):
6
- post = forms.CharField()
+ post = forms.CharField(widget=forms.TextInput(
7
+ attrs={
8
+ 'class': 'form-control',
9
+ 'placeholder': 'Write a post...'
10
+ }
11
+ ))
12
13
class Meta:
14
model = Post
home/templates/home/home.html
@@ -5,7 +5,8 @@
<h1>Home</h1>
<form method="post">
{% csrf_token %}
- {{ form.as_p }}
+ {{ form.post }}
+ <br>
<button type="submit">Submit</button>
</form>
<h2>{{ text }}</h2>
0 commit comments