Skip to content

renaissancor/fastapi-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Fast API Tutorial Setup Guide

  1. install python and create directory

If you haven't already installed Python, you can do so using Homebrew Create a directory where you'll store your FastAPI project. You can name it whatever you like. For example:

brew install python 
mkdir fastapi 
cd fastapi 
  1. Create a Virtual Environment

Create a virtual environment using Python's built-in venv module inside your project directory

python -m venv env
  1. Activate the Virtual Environment
source env/bin/activate # Mac OS 
.\env\Scripts\activate # Windows 
  1. Install Uvicorn and FastAPI
pip3 install uvicorn fastapi 
  1. Start the FastAPI tutorial

  2. Deactivate the Virtual Environment (Optional)

When you're done working on your FastAPI project, you can deactivate the virtual environment using:

deactivate 

Start and Finish Guide

Activate Python Virtual Environment

source env/bin/activate # Mac OS 
.\env\Scripts\activate # Windows 

Run uvicorn

uvicorn main:app --reload 

Documentation Link based on OpenAPI Standard

Open http://127.0.0.1:8000/docs

FastAPI alternative API documation by ReDoc

http://127.0.0.1:8000/redoc

Finish Python Virtual Environment

deactivate 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages