Fast, beautiful and extensible administrative interface framework for FastApi & Starlette applications
See the codeAn extensible administrative interface framework for FastAPI and Starlette applications.

# Using uv
uv add starlette-admin
# Using pip
pip install starlette-admin
Get a fully functional administrative dashboard up and running in minutes. This example demonstrates an integration with FastAPI and SQLAlchemy.
from contextlib import asynccontextmanager
from datetime import datetime, timezone
from fastapi import FastAPI
from sqlalchemy import create_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from starlette_admin.contrib.sqla import Admin, ModelView
engine = create_engine("sqlite:///blog.db", connect_args={"check_same_thread": False})
class Base(DeclarativeBase):
pass
class Post(Base):
__tablename__ = "posts"
id: Mapped[int] = mapped_column(primary_key=True)
title: Mapped[str]
content: Mapped[str]
published: Mapped[bool] = mapped_column(default=False)
created_at: Mapped[datetime] = mapped_column(
default=lambda: datetime.now(timezone.utc)
)
class PostView(ModelView):
fields = ["id", "title", "content", "published", "created_at"]
searchable_fields = ("title", "content")
@asynccontextmanager
async def lifespan(app: FastAPI):
Base.metadata.create_all(engine)
yield
app = FastAPI(lifespan=lifespan)
admin = Admin(engine, title="Blog Admin", secret_key="change-me")
admin.add_view(PostView(Post, icon="fa fa-newspaper"))
admin.mount_to(app)
Run with fastapi dev and open http://127.0.0.1:8000/admin.
starlette-admin is built to be agnostic. It ships with built-in support for popular ORMs and databases:
| Backend | Package Path |
|---|---|
| SQLAlchemy | starlette_admin.contrib.sqla |
| SQLModel | starlette_admin.contrib.sqlmodel |
| Tortoise ORM | starlette_admin.contrib.tortoise |
| Beanie (MongoDB) | starlette_admin.contrib.beanie |
| MongoEngine | starlette_admin.contrib.mongoengine |
| Custom Data Sources | Subclass BaseModelView |
Explore the interface in action: starlette-admin-demo.jowilf.com
Contributions are always welcome! Whether it is reporting a bug, discussing improvements, or submitting a pull request, your input helps make this project better.
Please review our CONTRIBUTING.md guidelines before opening a pull request.
This project is licensed under the MIT License.
197 followers · starred Jul 2025
93 followers · starred Jul 2024
41 followers · starred Apr 2025
115 followers · starred Apr 2025
Fast, beautiful and extensible administrative interface framework for FastApi & Starlette applications
See the codeAn extensible administrative interface framework for FastAPI and Starlette applications.

# Using uv
uv add starlette-admin
# Using pip
pip install starlette-admin
Get a fully functional administrative dashboard up and running in minutes. This example demonstrates an integration with FastAPI and SQLAlchemy.
from contextlib import asynccontextmanager
from datetime import datetime, timezone
from fastapi import FastAPI
from sqlalchemy import create_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from starlette_admin.contrib.sqla import Admin, ModelView
engine = create_engine("sqlite:///blog.db", connect_args={"check_same_thread": False})
class Base(DeclarativeBase):
pass
class Post(Base):
__tablename__ = "posts"
id: Mapped[int] = mapped_column(primary_key=True)
title: Mapped[str]
content: Mapped[str]
published: Mapped[bool] = mapped_column(default=False)
created_at: Mapped[datetime] = mapped_column(
default=lambda: datetime.now(timezone.utc)
)
class PostView(ModelView):
fields = ["id", "title", "content", "published", "created_at"]
searchable_fields = ("title", "content")
@asynccontextmanager
async def lifespan(app: FastAPI):
Base.metadata.create_all(engine)
yield
app = FastAPI(lifespan=lifespan)
admin = Admin(engine, title="Blog Admin", secret_key="change-me")
admin.add_view(PostView(Post, icon="fa fa-newspaper"))
admin.mount_to(app)
Run with fastapi dev and open http://127.0.0.1:8000/admin.
starlette-admin is built to be agnostic. It ships with built-in support for popular ORMs and databases:
| Backend | Package Path |
|---|---|
| SQLAlchemy | starlette_admin.contrib.sqla |
| SQLModel | starlette_admin.contrib.sqlmodel |
| Tortoise ORM | starlette_admin.contrib.tortoise |
| Beanie (MongoDB) | starlette_admin.contrib.beanie |
| MongoEngine | starlette_admin.contrib.mongoengine |
| Custom Data Sources | Subclass BaseModelView |
Explore the interface in action: starlette-admin-demo.jowilf.com
Contributions are always welcome! Whether it is reporting a bug, discussing improvements, or submitting a pull request, your input helps make this project better.
Please review our CONTRIBUTING.md guidelines before opening a pull request.
This project is licensed under the MIT License.
197 followers · starred Jul 2025
93 followers · starred Jul 2024
41 followers · starred Apr 2025
115 followers · starred Apr 2025