Developing a simple GUI web application
This section aims to demonstrate how the Flask
framework can be used to develop a simple web application. The focus is shifted toward building an application that captures form data, which is then passed to our deployed machine learning API:
- To start, create the following directory structure:
Most of the logic is handled in
app.py
, and thetemplates
folder is used to store HTML files for the app – more on that in a bit. - This time we'll organize the code a bit better, so you'll need to create an additional file for storing the environment variables. Inside the root directory (
webapp
), create a file called.env
– and populate it with the following:SECRET_KEY=SecretKey HOST=0.0.0.0 PORT=9000 API_ENDPOINT=http://ec2-18-220-113-224.us-east-2.compute.amazonaws.com:8000/predict
Creating a separate file like this is considered to be a best practice when developing...