I'm learning Django and web dev and having difficulty configuring the fields in Django forms.Form so that they come out correctly. Below is my code:
Even if I adjust my attrs rows and cols in forms.Textarea it doesn't make any difference. Also, it doesn't seem to matter what I put in CSS the output is still the same.
class NewPageForm(forms.Form):
title = forms.CharField(label="Title", max_length=100, widget=forms.TextInput)
content = forms.CharField(label="Content", widget=forms.Textarea(attrs{"rows":3,"cols":10}))
My html:
{% block body %}
<div class="form">
<form action="{% url 'create' %}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type = submit>
</form>
</div>
{% endblock %}
What it looks like:
Please advise.
