Skip to content

Template for a FastAPI application with mypy and flake8 configs for VSCode and strict typechecking.

License

Notifications You must be signed in to change notification settings

MoritzKronberger/fastapi-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ FastAPI Template

Template repository for a FastAPI + Uvicorn application with routers. (See FastAPI - Bigger Applications)

Includes setup for strict typechecking with mypy and linting with flake8 + settings for the VSCode Python extension.

Installation

Uses Python 3.10

Create a virtual environment:

python -m venv venv

Active the virtual environment:

./venv/Scripts/activate

Install dependencies:

python -m pip install -r requirements.txt

Run Application

Run Uvicorn server with hot reloads:

uvicorn app.main:app --reload

Access the docs at [http://127.0.0.1:8000/docs] or the alternative docs at [http://127.0.0.1:8000/redoc].

Run Typechecks and Linter

Run mypy for typechecks:

mypy -m app

Run flake8 for linting:

flake8

About

Template for a FastAPI application with mypy and flake8 configs for VSCode and strict typechecking.

Topics

Resources

License

Stars

Watchers

Forks

Languages