Welcome back.
Databases exist for us to store data that persists.
That is data that hopefully lasts for as long as we want it so we can analyze the data, maybe we can
grab it when we need it.
And that's what databases do.
And most of the time when you're working with web development, you have the front end that focuses
on the browser side of things.
So that is the CSS, the JavaScript, the HTML, we have the back end, which is usually the server
side where we can use things like Python, flask, Django to build a server.
And then we also have this database side in the back end where the server communicates with something
like MongoDB, a type of database to actually store this information.
So instead of storing that information on an Excel file like we have been, we can store it on an actual
database which gives us a lot more power.
Now again, this isn't a course about databases, so we don't need to fully go into the topic.
If I go back to server dot pie in the submit form, I want to wrap this in a try accept block just so
we can catch errors in a better way.
So after the post.
I'll do a try.
BLOCK.
And we'll just indent this and we'll also do a except here.
And in here, we'll just return if there's an error.
Something.
Or let's just say.
Did not save two database.
So that as we're testing this out, we know if something wrong has happened in our case.
We're going to check for the post.
If it's not a post method, then we have an else condition that's going to return something where I'm
wrong.
Try again.
And then we are going to try this piece of code.
Otherwise we're going to return.
Did not save to database.