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

Uploaded Python 3

File details

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

File metadata

  • Download URL: starlette_admin-1.0.0rc4.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.0rc4.tar.gz
Algorithm Hash digest
SHA256 59fbf97a462880ba4fd2c9b68cc7286da5750558aa324df2e0ce256ea54dc104
MD5 2d1aa8268dc72ce16a1f876305e7a561
BLAKE2b-256 b94d7daef7ff88684dc09fbaee0b013bcdfa4d07fdcff15a502138a54744fb4e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starlette_admin-1.0.0rc4-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.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 a9620eabf6883a0afd45add318b0e01054d88770ec489856c30648b7577e4585
MD5 1d48572b4748f3f22711e987df0e79e7
BLAKE2b-256 860bed48029eb4ecacfbddeebef0a82f5002ff5024571c5b9802fe5331a3c136

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