Skip to main content

adminsite

An admin panel for the SQLAlchemy 2.0 ORM that works with FastAPI, Starlette and Litestar.

PyPI Python CI License

Live demo · Documentation · Changelog · Discussions · For AI assistants

The orders list of the demo shop

Installation

pip install adminsite

Add the driver your database needs, such as asyncpg or aiosqlite.

Usage

from adminsite import Admin, Link, ModelView


class OrderView(ModelView[Order]):
    fields = [Order.id, Order.customer, Order.status, Order.total]
    searchable_fields = [
        Link(Order.customer, Customer.name),
        Link(Order.customer, Customer.email),
    ]
    list_filters = [Order.status, Order.created_at]


app.mount("/admin", Admin(engine, views=[OrderView]))

The settings name your models' own attributes, so a type checker catches a misspelt one. The labels, filters, form controls and validation come from your models. Getting started builds a working admin in one file.

Features

  • Pages from your models: a searchable, sortable list with filters and saved views, a page for each record, and forms with validation.
  • Editing in the list for a value that changes often, such as an order's status.
  • Lists that keep up to date on their own, for records that come in while people watch, such as new orders.
  • Form layouts with panels, rows and tabs, which the record page follows too.
  • Related records: pick a related record from a searchable list, and edit child rows, such as an order's lines, inside the parent's form.
  • JSON columns edited with a form built from a Pydantic model or a TypedDict, instead of a code box.
  • Built-in filters for choices, yes or no, number and date ranges, related records picked by name, and text.
  • Custom filters for anything the built-in ones do not cover, such as "overdue" or "spent over €1,000".
  • Actions that run your own code on the selected rows, on every row the filters match, on one record or on the whole table, with a dialog for any values they need.
  • Permissions for each view, action, field and row.
  • Hooks that run your code before and after a save or delete, in the same transaction, and can refuse it with a message.
  • An audit log: who changed what and when, including actions, exports and sign ins, with a history on every record and an activity page you can filter.
  • Import from CSV or Excel with a preview of every row, and export to CSV.
  • File and image uploads, stored on disk or wherever you choose.
  • A dashboard of stats, charts and the latest records.
  • A command palette: Ctrl K jumps to any page or record.
  • A JSON API that shares the same views and permissions.
  • Signing in with a fixed list of users or your own user table.
  • Pages and plugins of your own, such as reports or settings, in the same layout.
  • Translations into eleven languages, among them Persian and Arabic laid out right to left, and every time shown in the reader's time zone.
  • Light and dark themes, a layout for phones, and pages that work with a keyboard and a screen reader.
  • Async or sync, on SQLite, Postgres and MySQL, with no N+1 queries.
  • SQLModel models as they are.
  • Large tables: rows never wait for their count, which can be estimated or skipped, and page 400 costs the same as page 1.
  • No Node and no CDN: everything ships inside the package.

Motivation

Our business ran its back office on sqladmin, and then on starlette-admin. We needed features neither had, and in the end I had changed starlette-admin so much that turning it into pull requests would have taken more time than I had. So I built adminsite on what we learned from both, with everything our team needs.

It is not a side project. Our back office runs on it every day, and I keep developing it. An admin panel is not what sets our business apart, so it is open source, for anyone to use and improve.

adminsite is for SQLAlchemy only, and will stay that way. SQLModel models work too, since they are SQLAlchemy models, but I do not use SQLModel myself. If you do, reports and fixes are welcome.

How it works

adminsite is one ASGI app, mounted inside yours. Every page and the JSON API go through the ModelView you write for each model, so its rules hold everywhere.

A request goes from the browser or a script to adminsite's pages or JSON API, through each model's ModelView and a SQLAlchemy repository, to your database

Documentation

  • Getting started builds a working admin in one file.
  • Views covers everything a view can say about a model.
  • Permissions is worth reading before you put the admin in front of anyone.
  • The reference lists every class and option.

Contributing

Ask a question or share an idea in Discussions. Issues and pull requests are welcome. CONTRIBUTING.md says how to run the tests and rebuild the stylesheet.

License

MIT

Metadata

Release files for adminsite 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adminsite 0.2.0
File Size Uploaded
adminsite-0.2.0.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for adminsite 0.2.0
File Interpreter ABI Platform
adminsite-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.1 MB

Release files / adminsite-0.2.0.tar.gz

Download URL adminsite-0.2.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
13168c3ecd0239c4fa622d5d8962dbfcd2ee48f3ee4cc58e4c8888e8822155bd
BLAKE2b-256 checksum
How to use checksums
253c44eb00127bf21f141bfc4b16385e85db084479d7ebc26e4f1fd13f0872fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / adminsite-0.2.0-py3-none-any.whl

Download URL adminsite-0.2.0-py3-none-any.whl
Size 509.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b8dab2e0b19c66c115f21dea406c2b6101dc84fa57c8fde08402faa8df6c9f8
BLAKE2b-256 checksum
How to use checksums
a1f937af5a4124ae74d109b89f1d8c7767e7159cecb02341e1719f797c6910b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page