Skip to content

sleep1223/fastapi-radar-with-tortoise-orm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Radar(Tortoise ORM 适配版)

中文 | English

本仓库是 fastapi-radar 的 Tortoise ORM 适配版

默认访问地址:http://localhost:8000/__radar

安装

Install from GitHub repository:

pip install git+https://github.com/sleep1223/fastapi-radar.git

Install with uv:

uv add git+https://github.com/sleep1223/fastapi-radar.git
uv run pip install git+https://github.com/sleep1223/fastapi-radar.git

Install from local source:

uv run pip install .

Dev install:

uv run pip install -e ".[dev]"

## 使用

最小可用示例(集成 Tortoise ORM):

```python
from fastapi import FastAPI
from fastapi_radar import Radar
from tortoise.contrib.fastapi import register_tortoise

app = FastAPI()

radar = Radar(app)

register_tortoise(
    app,
    db_url="sqlite://example.db",
    modules={"models": ["your_app.models", "fastapi_radar.models"]},
    generate_schemas=True,
    add_exception_handlers=True,
)

@app.get("/")
async def index():
    return {"message": "ok"}

启动应用后,访问:

运行测试

  1. 安装开发依赖:
uv add pytest
  1. 在项目根目录运行全部测试:
uv run pytest
  1. 如果只想运行标记为集成测试的用例:
uv run pytest -m integration

About

A powerful debugging dashboard for FastAPI applications. Monitor HTTP requests, SQL queries, and exceptions in real-time with a beautiful React UI. One-line integration, zero configuration needed.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 98.9%
  • Makefile 1.1%