Skip to main content

FastAPI Panel

A modular admin panel for FastAPI.
Register a SQLAlchemy model, get a secure back office.

CI PyPI Python 3.10+ MIT license

The product list, with search, filters, bulk actions and inline editing

If you know ModelAdmin, you already know this library: list_display, search_fields, list_filter, fieldsets, inlines, actions and the rest work the way you expect. There is no frontend build, no Node and no extra service. It's server-rendered pages inside your FastAPI app.

Install

pip install fastapi-panel

Quick start

from fastapi import FastAPI
from fastapi_panel import ModelAdmin, ModelAuth, register, site
from sqlalchemy.ext.asyncio import create_async_engine

from myapp.models import Product, User

engine = create_async_engine("postgresql+asyncpg://...")
app = FastAPI()


@register(Product)
class ProductAdmin(ModelAdmin):
    list_display = ("name", "category", "price", "is_published")
    list_filter = ("is_published", "category")
    search_fields = ("name", "category__name")
    ordering = ("-created_at",)


site.mount(
    app,
    engine=engine,
    auth=ModelAuth(User, superuser_field="is_superuser"),
    secret_key=settings.PANEL_SECRET_KEY,
)

Open /admin, log in, and you have a list page, add and edit forms, delete confirmation, bulk actions, CSV export and a change history. See the getting started guide for creating your first user with python -m fastapi_panel createuser and setting up migrations.

Want to try it first? The example shop runs in one command.

What you get

Change lists Columns, computed columns, sorting, search across relations, sidebar filters, saved filters, date drill-down, pagination, editing in the list
Forms Warn before leaving with unsaved changes. Built from your models, with fieldsets, read-only fields, prefilled slugs, validation hooks, Pydantic schemas, a rich text editor, foreign key autocomplete, many-to-many pickers, and a + button to create a related record on the spot
Files and images Uploads with previews and thumbnails, stored on disk or anywhere else through a small storage class
Import and restore CSV import with a preview before anything is saved, and a Deleted page to restore soft-deleted records
Inlines Tabular and stacked, with add, edit and delete on the parent's page
Actions Your own bulk actions and buttons on a single record, plus delete with a tree of what cascades and what blocks it, CSV export and "select all across pages"
Accounts and permissions Staff groups with a permissions grid, per model and per action, row-level through get_queryset and has_*_permission, password reset by email, and optional two-factor login with an authenticator app
Dashboard Your own stat cards, such as orders to ship or low stock, each linking to a filtered list
Live settings Values people change in the panel with no deploy, such as a banner or a shipping threshold
Audit log Who changed which fields and when, on each record's history and a site-wide Activity page, with old and new values for the fields you choose
Any SQLAlchemy setup Sync and async engines, SQLModel, composite primary keys
Timezones Show and enter times in your site's timezone, while the database stays in UTC
Interface Dark mode, works on a phone, keyboard friendly, no external assets
The dashboard with stat cards, every model and recent actions Setting up two-factor login by scanning a QR code
An order with its items edited inline, with search boxes and a + button for related records

Security

An admin panel can reach all your data, so these are on by default and have no off switch to forget:

  • CSRF tokens and Origin checks on every POST
  • Signed HttpOnly, SameSite=Lax session cookies, Secure on HTTPS, ended by a password change or by deactivating the user
  • Login throttling, no way to tell a wrong username from a wrong password, scrypt password hashing
  • A strict Content-Security-Policy with no inline scripts or styles, X-Frame-Options: DENY, no-store caching
  • Columns named like password, token or secret stay hidden unless you ask for them, and the audit log stores field names, never values
  • Only fields on the form can be written, and sort and filter parameters are allowlisted
  • Spreadsheet formulas are neutralised in CSV exports
  • Uploads get random names, images are checked against their contents, and files are only served behind login

The panel refuses to start without authentication or with a short secret key. Read the security guide for what's left to you.

Documentation

Roadmap

Translations, two-factor login, and a Redis option for login throttling across workers. Ideas and pull requests are welcome, see CONTRIBUTING.

License

MIT

Metadata

Release files for fastapi-panel 0.3.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 fastapi-panel 0.3.0
File Size Uploaded Provenance Actions
fastapi_panel-0.3.0.tar.gz 1.5 MB Without provenance Details for fastapi_panel-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-panel 0.3.0
File Interpreter ABI Platform Actions
fastapi_panel-0.3.0-py3-none-any.whl Python 3 none any Details for fastapi_panel-0.3.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / fastapi_panel-0.3.0.tar.gz

Download URL fastapi_panel-0.3.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
16276062d436cf6a95827401e54b107dfb2d9e0201809a4e3f2dc4112ad646d9
BLAKE2b-256 checksum
How to use checksums
301a4cf61f47aac72fcee2b639dc90567680b5b4941d9c15d8863c29c247fc9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fastapi_panel-0.3.0-py3-none-any.whl

Download URL fastapi_panel-0.3.0-py3-none-any.whl
Size 99.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81db818ea70ddb16ea40b7d7cf63d068d54d6a315c7e9268e51f953ff60d911d
BLAKE2b-256 checksum
How to use checksums
96135f070ce4bcec590e4ce098868a5a299d1171d67101afb40d44257030de0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fastapi-panel 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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