Instructions for Linux/MacOS.
-
Install MySQL; Note down root user password
-
Start MySQL Server
-
Login to MySQL Server and create a database
- mysql
- create database greetings_db;
-
Set environment variables on the shell export DB=greetings_db export USER=root export PASSWORD= export HOST=localhost
-
Create VirtualEnv python3.8 -m venv venv
-
Activate VirtualEnv . venv/bin/activate
-
Install Python libraries and dependencies pip install -r requirements.txt
-
Start application python application.py
-
Access the application in browser http://localhost:5000/
This should show the application form -> Enter some message in the text box. -> It should show up in the form.
The application creates table named 'greetings' inside the database which you specified via the DB environment variable.
-
Login to MySQL Server
$ mysql --user=root --password= --host=localhost
mysql>show databases;
mysql>use greetings_db;
mysql>show tables;
mysql>describe message;
mysql>select * from message;
--> Verify that the message that you added is in the table.