github code for article https://gerrysabar.medium.com/fastapi-simple-crud-with-mysql-sqlalchemy-e60dd04a5c7e
Ensure you have the following installed:
- [Python] (https://www.python.org/downloads/) (v3)
-
Clone the repository:
git clone https://github.com/gerry-sabar/fastapi-todo
-
Inside project root directory create virtual environment:
python3 -m venv venv
-
Activate the virtual enviroment:
source venv/bin/activate -
Install requirements:
pip3 install -r requirements.txt
-
Adjust database connection in database.py according to your mysql configuration
-
Run locally:
fastapi dev main.py
-
You can access API documentation from here:
http://localhost:8000/docs