Answer the question
In order to leave comments, you need to log in
Why is the form not rendering?
Doesn't render the views
form
def contact_Form(request):
if request.method == "POST":
form = contactForm(request.POST)
return render(request, 'about/about.html', {'form':form})
class contactForm(forms.ModelForm):
class Meta:
models = contact
fields = ('name', 'email', 'text')
class contact(models.Model):
name = models.CharField(verbose_name = "Имя", max_length=60, blank=True, default=None)
email = models.EmailField()
text = models.TextField(blank=True, default=None)
<div class="div">
{{ form.as_p }}
</div>
Answer the question
In order to leave comments, you need to log in
After 'aboutPost5': ...
Add 'form': contactForm.
Also google "PEP8" and read.
One more thing. If you are assigning variables aboutPost1-5 then you are doing something wrong. Add a field to the model that will combine all these records, and filter by it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question