DEV Community

Cover image for JWT Authentication with FastAPI
Bek Brace
Bek Brace

Posted on

17 5

JWT Authentication with FastAPI

FastAPI : a great framework for creating APIs, it takes very small effort to realize how fast it is in comparison with other frameworks like Flask, Pyramid, bottle, tornado and Django.

Developers are switching from Flask to FastAPI for a lot of reasons like speed, for instance.

This is techempower.com, an independent website that benchmarks web servers by running a variety of tests on them, FastAPI (with Uvicorn, the ASGI server implementation) is one of the fastest web servers.
Image description
This is a performance comparison executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration.

And why I prefer FastAPI over others Fws is because of its high performance, ease of syntax, you have something like Pydantic that allows modern python typing, also asynchronous requests with Async/Await syntax .. and no wonder that FastAPI is on par with Go language and Node JS (which is built on the V8 engine, the same engine of Google Chrome)

Take a look at my latest video on the channel where you can learn how to build user authentication with web based tokens using JWTs ( pronounce Jots) or JSON Web Tokens; and how this is better than the traditional cookie based sessions

Thank you for reading ( and maybe watching :) )
I will see you in next Video posts, till then stay safe and be well, friends

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (1)

Collapse
 
archie_lc profile image
Archie β€’

I wish you wrote a full article, just as I was starting to garner interest I saw the YouTube embedding and I've never felt this sad before to come to the completion of an article

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay