Build A REST API With FastAPI, Beanie and MongoDB

preview_player
Показать описание
This video demonstrates how we can put together a REST API With FastAPI, Beanie, and MongoDB. Based on common Python type-hints, FastAPI is a cutting-edge, quick (high-performance), web framework for creating APIs using Python.

Based on Motor and Pydantic, Beanie is an asynchronous Python object-document mapper (ODM) for MongoDB.

We use the combination of these tools to build a simple CRUD API.
#python #mongodb #fastapi

SOURCE CODE:

PLEASE BUY E A COFFEE

TIMESTAMP:
0:00 Introduction
5:08 Project set up
9:40 Creating a FastAPI server
13:40 Creating the API endpoints in a router
18:34 Including the router into the main application
19:32 Creating a Document model class
25:25 Connecting to MongoDB with FastAPI
31:30 Retrieving all resources
37:44 Creating resources
41:40 Retrieving a single task
45:52 Updating a resource
54:02 Deleting a resource
56:02 Setting response status codes
58:37 API Documentation with Swagger UI
59:29 Wrapping Up
Рекомендации по теме
Комментарии
Автор

Great tutorial. I was very happy to see you catch the /tasks and the object id errors. I saw them and thought they were wrong -- good to have confirmation. Thanks!

rickhoro
Автор

Finally someone I can understand,
Please add authentication with jwt token as part two.
I find it hard to wrap my head around it with fastapi authentication.

Cheers 🥂

raymondmichael
Автор

I spent the whole last week trying to make my backend work with MongoDB, and after going mad with Beanie's, ODMantic and MongoDB documentation, plus freaking github's forums and communities, you finally solved my doubts on what I was doing wrong and made it work! THANK YOU!

StefanoOlla
Автор

Thank you, finally I understand how to integrate a mongodb in my fastapi application! :)
Like and subscribe❤

eyeseyeseyes
Автор

Keep up with great content! Definetly subscribed

uniongrob
Автор

This is what I have always wanted. Rest APIs, I think this is a good start up. Otherwise we appreciate for the Good work.

amonmuhwezi
Автор

More Informative with good explanation. More helpful! Thanks for making this video!! Have a nice day..

deepasri
Автор

Hey, Jonathan, i know your views right now are really very less, but believe me you are gem, love from india

rajshah
Автор

Great video as usual.
Thank you for sharing

suen-tech
Автор

Great video man. Very discriptive and clear! Keep it up. Subscribed.

shinchikichin
Автор

Sir, can u cover deployment please..
I'm really having issues deploying these apps to live server.

gocarry
Автор

If you can do a video integrating FastApi with an admin package like FastAdmin or SQLADMIN

fidelischukwunyere
Автор

is it possible to customise _id to our requirements... gr8 video btw :)

amritsubramanian
Автор

when i type "python run.py" its showing : can't open file or no such directory or file, what is the issue?Please rectify.

menaazfatima