Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-10 Thread Sim
Form should be provided in context render of index view . Try this please and let me know if it worked On Sunday, June 9, 2019, Marvelous Ikechi wrote: > I couldn't find a description field in the creation of your ContactForm. > Maybe it's an oversight from me. However, if it isn't, I'm not expe

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-09 Thread Marvelous Ikechi
I couldn't find a description field in the creation of your ContactForm. Maybe it's an oversight from me. However, if it isn't, I'm not expecting to see a {{card.description}} in your cards.html page. On 12:30PM, Fri, Jun 7, 2019 Delcy John wrote: > i think the error is in form.py,you must put i

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-07 Thread Delcy John
i think the error is in form.py,you must put indentation in class On Fri, Jun 7, 2019 at 9:37 AM Joe Reitman wrote: > Interesting problem. It won't display because the form is inside a > for-loop. Django Template language looks at variables inside a for-loop > differently. Basically it looks for

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-06 Thread Joe Reitman
Update. You can do this by hard coding the HTML form in the template. If you want to gather the data a user enters, each form will have to be uniquely identifiable and your view will have to determine which form its getting post data from. You can put the card index number in the button value

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-06 Thread Joe Reitman
Interesting problem. It won't display because the form is inside a for-loop. Django Template language looks at variables inside a for-loop differently. Basically it looks for a collection. Since {{ form }} is not a collection, it just ignores it. I'm not sure how you can create multiple forms l

How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-06 Thread Majid Rafiee
I've created a form in Django: #forms.py from django import forms class ContactForm(forms.Form): name = forms.CharField() number = forms.FloatField() eail_user = forms.EmailField() and imported in in views.py #views.pyfrom django.shortcuts import renderfrom .models imp