'django include tag forms
I'm trying to include a template with a form to another template but when I try to use
{% include 'index.html' %}
it returns blank
forms.py
class CreateIdForm(forms.ModelForm):
class Meta:
model = models.Authenticate
fields = ['id', 'username', 'password']
Main template (home.html)
<h2>Below is from index.html</h2>
{% include 'index.html' %}
Side template (index.html)
<table>
<th colspan="2">Some table</th>
<form method="post">
{{form.as_table}}
{% csrf_token %}
<th colspan="2"><input type = 'submit' class="btn btn-primary" value="submit"></th>
</form>
</table>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
