返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
Python

By 2025, apart from Django, what other options are there for Python web frameworks?

It's 2025—what's left outside of Django? LiteStar is lightweight and fast, Tortoise ORM saves headaches, Granian eliminates Nginx, and Robyn combines Python with Rust. Are independent developers finally free from being forced into an unwanted bundle?

曦远 (DealiAxy)约 11 分钟
目录6 个章节

Foreword

Hello everyone, I'm Xiyuan~

A while ago, I wrote an article titled "Is Django Outdated? Thoughts from ASGI to the AI Era", discussing how traditional full-stack frameworks (like Django) should face new trends in the age of AI.

Recently, while renovating the DjangoStarter project, I did some research along the way and found that the Python Web ecosystem is evolving even faster than I imagined.

On one hand, veteran players like Django now have fresh add-ons like Ninja. On the other hand, if you choose not to follow the full-stack route of Django, there's a batch of emerging lightweight frameworks and tools that are pushing Python Web into a new phase: lightweight + async-first + Rust-powered.

So in this article, I'll talk about several new options worth watching in 2025: LiteStar, Tortoise ORM, Granian, and Robyn.

LiteStar

LiteStar is an emerging ASGI-based framework, positioned somewhat as an evolved version of FastAPI.

  • Advantages: Complete type hints, natural dependency injection, and good performance.
  • Disadvantages: Moving away from the Django ecosystem means you have to choose and configure ORM and admin management yourself.
  • Target Audience: Independent developers and small projects that prioritize lightweight and flexibility.

When I tried it out, the biggest takeaway was that its writing style is clean and less burdened by historical baggage compared to Django.

Later on, I will use LiteStar to develop a formal project to test the waters.

I’ll share more when that happens.

Async ORM

Leaving the Django ecosystem, the thing you'll probably miss most is the ORM.

LiteStar doesn't have a built-in ORM, so which one should you choose? Personally, I recommend Tortoise ORM.

Its syntax is very similar to Django ORM.

class Event(Model):
    id = fields.IntField(pk=True)
    name = fields.CharField(max_length=255)
    start_time = fields.DatetimeField()

Looks a bit familiar, right?

For Django users, the learning curve is very low.

  • Pros: Async-native, syntax consistent with Django ORM.
  • Cons: The ecosystem is not as large as Django ORM's, and community activity remains to be seen.

If you're used to Django ORM but want async/await, Tortoise ORM is a great choice.

Granian

A high-performance server powered by Rust

At the deployment level, I recently discovered a new tool: Granian.

  • An ASGI server written in Rust, faster than Uvicorn/Daphne.
  • Can handle static files directly, eliminating the need for Nginx in many scenarios.
  • Built-in multi-worker support simplifies the deployment process.

In other words: it replaces both Daphne and Nginx at once.

I plan to use Granian in subsequent experiments with DjangoStarter to see if it can eliminate a reverse proxy layer. After all, I've been scratching my head recently over how to elegantly integrate the URL Prefix functionality into DjangoStarter's Nginx configuration 🤣

Robyn

Python syntax + Rust performance

Another noteworthy framework is Robyn. Its approach is: use Rust to write the underlying runtime and Python to provide the API layer.

This way, you get both the ease of use of Python and performance close to Node.js/Rust frameworks.

  • Built-in routing, static files, and templates
  • High-performance async runtime
  • Developer-friendly, with a syntax similar to Flask/FastAPI

It looks like a very cool framework that combines Python's ease of use with Rust's performance. In short, it's about balancing productivity and speed, and it seems worth exploring.

Summary

The Python Web ecosystem in 2025 is no longer just about Django vs Flask vs FastAPI.

The new trends are:

  • Lighter frameworks (LiteStar)
  • ORM with native async support (Tortoise)
  • Faster and simpler deployment layers (Granian)
  • Performance powered by Rust (Robyn)

My takeaway is: Django remains important, but new frameworks have brought more possibilities for independent developers and small teams.

In the future, I plan to try out Robyn and Granian in real projects to see if the Python workflow combined with Rust performance can be effectively realized.

_EOF_

By 2025, apart from Django, what other options are there for Python web frameworks?

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

使用Python+FFMPEG实现视频分割与合并

前言 日常中偶尔会遇到需要简单剪辑处理视频的场景,以前我可能会拿出PR来剪辑一下,(别跟我说国产那些软件,剪辑完视频强制加上广告片头片尾恶心的一批),但是PR毕竟太重量级,剪个简单的视频都要花不少时间,直到我发现了FFmpeg…… 这个FFmpeg真的是神器,免费开源功能强大,好像很多软件都是基于这个开发的,它本身提供了命令行接口就已经能满足我们日常的简单视频处理需求,我用来简单处理视频分割、合并

2022-05-27 · Python · 约 1 分钟

自己动手开发简单消息队列(异步任务队列):Python实现

又是造轮子系列咯,Python上有很多成熟完善的异步任务队列框架可以用,比如Celery,或者RQ,不过这些都不自带消息队列服务,都需要使用Redis、RabbitMQ之类的消息队列才行,我用到小项目中又不需要附带这么多东西,于是自己动手来实现咯。 思路 将需要异步执行的任务添加到队列 自动从队列中取出任务,创建新线程执行 保存任务的执行结果和输出 任务完成,调用回调函数,处理返回的数据 使用输出

2021-12-18 · Python · 约 1 分钟

关于Python的异常处理

前言 异常处理在任何一门编程语言里都是值得关注的一个话题,良好的异常处理可以让你的程序更加健壮,清晰的错误信息更能帮助你快速修复问题。在Python中,和部分高级语言一样,使用了try/except/finally语句块来处理异常,如果你有其他编程语言的经验,实践起来并不难。 Python 中(至少)有两种错误:语法错误和异常( syntax errors 和 exceptions )。下面稍微介

2022-05-27 · Python · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…

By 2025, apart from Django, what other options are there for Python web frameworks? · StarBlog