This repository contains a simple Todo application built with FastAPI and SQLite. The aim is to help beginners get started with FastAPI by creating a basic CRUD (Create, Read, Update, Delete) application.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.6 or higher
- virtualenv (Optional, but recommended)
It's recommended to create a virtual environment to manage dependencies for this project. This can help ensure that the project and its dependencies do not affect your system Python installation.
-
Install
virtualenvif you haven't already:pip install virtualenv
-
Create a new virtual environment in the project directory:
virtualenv venv
-
Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Clone the repository to your local machine:
git clone https://github.com/ronaldojr/blog_first_fastapi.git cd blog_first_fastapi -
Install the required packages:
pip install -r requirements.txt
-
With your virtual environment activated, run the following command:
uvicorn main:app --reload
-
The FastAPI application will start running on
http://127.0.0.1:8000. You can access the interactive API docs athttp://127.0.0.1:8000/docsto try out the API endpoints.
This project includes a basic test suite. To run the tests, use the following command:
bash pytest
Feel free to fork this repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE.md file for details.