In this recipe, we will create an application that will help us to store products to be displayed on the catalog section of a website. It should be possible to add products to the catalog, and then delete as and when required. As we saw in previous chapters, this is possible to do using non-persistent storage as well. Here, however, we will store data in a database to have persistent storage.
Creating a basic product model
How to do it...
The new directory layout would appear as follows:
flask_catalog/ - run.py
my_app/ - __init__.py catalog/ - __init__.py - views.py - models.py
First of all, start with modifying the application configuration file, that is, flask_catalog...