From the course: Building RESTful APIs with Flask

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Viewing the database in DB Browser for SQLite

Viewing the database in DB Browser for SQLite

From the course: Building RESTful APIs with Flask

Start my 1-month free trial

Viewing the database in DB Browser for SQLite

- [Instructor] At this point, we have our scripts in order. There is one thing I forgot though on the seed script. So let's go ahead and fix this really quickly before we jump in to how to actually run these commands. So I used DB dot session dot add but I forgot to add DB dot session dot commit. A lot of databases require you to use commit in order to save your changes. Without it, the script will run normally but nothing will get done, nothing will be added to your database. And since in the other ones I printed out a message, I'll go ahead and print a message here too, "Database seeded." I'll go ahead and save my work. And the next question again is how do we actually run these things? Well, it's pretty easy. You can use a terminal for this. And there happens to be one built in to PyCharm. If you're not using PyCharm, don't forget you can use any terminal you want to but don't forget to activate your virtual environment first. The PyCharm terminal does this for us automatically…

Contents