Skip to content
Advertisement

How should I insert html input data into a Django database

I can’t figure out how to fix this problem. I’m trying to insert some data from a html form into a small simple Django database; SQLite if I’m right.

I tried to follow tutorials and did allot of searching online but it seems like I’ve hit tutorial hell.

my question is: How can I achieve putting data from the text input field on the html file into the Django database?

Here’s what I’ve got so far:

the HTML:

JavaScript

the views.py

JavaScript

the models.py

JavaScript

the urls.py:

JavaScript

]

so what happens is: when I submit the page refreshes and doesn’t add the data. Which is added to the home page with in the views.py:

JavaScript

Thanks Tim! for noting the action="check" error, though it didn’t fix my problem!

Advertisement

Answer

JavaScript
Advertisement