Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

starlette-admin

An extensible administrative interface framework for FastAPI and Starlette applications.

Tests Coverage PyPI version Python versions

Admin panel

Installation

# Using uv
uv add starlette-admin

# Using pip
pip install starlette-admin

Quickstart

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.

Features

  • Generated CRUD pages for your models
  • Pagination, sorting, search, and shareable URLs
  • Nested AND/OR filter builder
  • Inline editing for related models
  • Bulk actions and custom row actions
  • CSV, Excel, JSON, and PDF export
  • CSV, JSON and Excel import with dry-run validation
  • Local and S3-compatible file storage (Amazon S3, MinIO, ...)
  • Event hooks before and after CRUD operations
  • Pluggable authentication, storage, fields, actions, and model views
  • Theme customization, dark mode, internationalization, and timezone support

Supported ORMs & Backends

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

Documentation & Resources

Live Demo

Explore the interface in action: starlette-admin-demo.jowilf.com

Contributing

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.

License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlette_admin-1.0.0rc3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starlette_admin-1.0.0rc3-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file starlette_admin-1.0.0rc3.tar.gz.

File metadata

  • Download URL: starlette_admin-1.0.0rc3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for starlette_admin-1.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 3b641a8d6a6b2f27fff45d1887e0c01ae922ba5482c0111b8c3cae5d20ea72bf
MD5 446ec5d33f7720b5f0bbc3e4966874c0
BLAKE2b-256 6fceb8a02672fc9659d556155be99b90eeb4255763158dd791c55b65dc07ff94

See more details on using hashes here.

File details

Details for the file starlette_admin-1.0.0rc3-py3-none-any.whl.

File metadata

  • Download URL: starlette_admin-1.0.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for starlette_admin-1.0.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2f8353654939fdec18a67b6de6e426df1b563c366e5768055cfb5dc57114a8
MD5 f5216b75e36ca687c29ef0a1957b4a43
BLAKE2b-256 d0d547f0474d6fc0d2fb961e337ca5d8cd3988b536abf00f599104987a72c7f0

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page