This project is a Flask web application designed to interact with a MySQL database. It provides various routes for managing sample data, querying information, and displaying documentation.
Before you begin, ensure that you have the following installed on your system:
- Python 3.x
- MySQL Server (or access to a remote MySQL database)
Start by cloning this repository to your local machine:
# Choose either http or ssh
# http
git clone https://github.com/pinskylab/db_web_framework.git
# ssh
git clone [email protected]:pinskylab/db_web_framework.git
cd db_web_framework
python3 -m venv env
# Source Environment
source env/bin/activate
pip install -r requirements.txt
# Create your config which will be used to connect the app to the database
Ensure that you have the correct database credentials by modifying the config.py file. The Config class in config.py should look like this:
class Config:
MYSQL_HOST = 'your_mysql_host'
MYSQL_USER = 'your_mysql_user'
MYSQL_PASSWORD = 'your_mysql_password'
MYSQL_DB = 'your_mysql_database'
Ensure that your MySQL server is running and the database specified in the configuration (MYSQL_DB) exists.
You may need to set up the necessary tables and stored procedures for your application. If these are not already created, you can create them manually or consult your project documentation for instructions.
Once the environment is set up, you can run the Flask application using the following command:
python3 app.py
By default, the Flask app will be available at http://127.0.0.1:5000