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.0rc5.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.0rc5-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: starlette_admin-1.0.0rc5.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.0rc5.tar.gz
Algorithm Hash digest
SHA256 3b15e7bdf1bab1ea5d615a97596f00d08de6df2a6d8d675fce6b1269546adb50
MD5 cd270c257f0a1de9493ae4c22aee5b7f
BLAKE2b-256 9bff72c734e294222b8763896f8c0cb6b9184716ec04d554f67efd5e310ebb81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starlette_admin-1.0.0rc5-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 cdad28af49cbd155ea89a13da97830ee9e442595756909e327ee896bf509b80f
MD5 c168f4a68d0f76520bc9c332e3ac7e11
BLAKE2b-256 c9ac04b00ccbf00bed33eb923d96d39ff1b7d9d7558c9a1e5c920dfc44312ba0

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