Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 917 Bytes

LEARN.md

File metadata and controls

44 lines (33 loc) · 917 Bytes

Sample CRUD FastAPI with MongoDB

Introduction

I'm going to build a sample CRUD with FastAPI and MongoDB. Using this sample to understand how to connect FastAPI with MongoDB.

Installations

git clone https://github.com/bsthen/Sample-CRUD-FastAPI-MongoDB.git && cd Sample-CRUD-FastAPI-MongoDB

Create a virtual environment:

python3 -m venv env

Or looking for install virtual envirometns link here.

Activate ENV for Linux or macOS

source env/bin/activate

Or

Activate ENV for Windows

\env\Scripts\activate.bat

Install Dependencies

pip3 install -r requirements.txt

Run the application

uvicorn main:app --reload

Open http://localhost:8000/docs/

Database

please copy sample.env and rename it to .env and replace your mongodb connection url.