Skip to content
Advertisement

Django Rendering Form in HTML Issue

I’m attempting to render a form, in html and have tried the normal {{ form }}. However when I go to the site set up by: python manage.py runserver. I get the following where the form should go (highlighted section on screen-capture)

webpage

This is the code for the form in question.

forms.py

JavaScript

This is the html in question. I’ve removed non-relevant segments

home.html

JavaScript

Lastly I’ve included the views as I suspect it might have something to do with it but I’m not certain. I’m trying to make it so that when the form is submitted the page is reloaded.

Views.py

JavaScript

Advertisement

Answer

Try:

JavaScript

I believe you are not instantiating the model and that’s the problem.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement