DEV Community

Cover image for Trying FastAPI as a Python Django developer.
Gourav Singh Rawat
Gourav Singh Rawat

Posted on

Trying FastAPI as a Python Django developer.

Hello readers!

It's been almost 3 years and most of the time I've always chosen Django, you ask? Well, Django provided everything out of the box I could ask for from authentication to database flexibility and whatnot.

What about the FastAPI though?
FastAPI is a modern, fast (as the name suggests), and highly performant web framework for building APIs with Python. If you're familiar with Django, exploring FastAPI can introduce you to some exciting features and differences. Here are some amazing things about FastAPI that might appeal to a Django developer:

1. Automatic Documentation:

FastAPI automatically generates interactive API documentation using OpenAPI and Swagger UI.

2. Async Support:

FastAPI is designed with asynchronous support, enabling efficient handling of concurrent requests.

3. Automatic Data Validation:

Python type hints are used for automatic data validation, reducing the need for manual validation code.

4. Dependency Injection:

FastAPI features a powerful dependency injection system for managing and injecting dependencies into endpoints.

5. Built-in Authentication:

FastAPI provides built-in support for OAuth and JWT authentication, streamlining the implementation of user authentication and authorization.

Soon I'll be posting a good beginner tutorial about FastAPI so stay tuned!!!

So my suggestion would be if you're going to build a project with a limited use and fewer developer features, go with FastAPI.

Top comments (0)