8000 GitHub - klen/muffin-admin: Admin interface for Muffin Framework · GitHub
[go: up one dir, main page]

Skip to content

About

Admin interface for Muffin Framework

To 8000 pics

Resources

Code of conduct

Contributing

Security policy

Stars

18 stars

Watchers

1 watching

Forks

Repository files navigation

Muffin-Admin

Muffin-Admin mounts a react-admin single page application on top of Muffin-REST resources. A resource that already has a REST API gets list, create, edit and delete screens without writing any JavaScript.

Read the documentation for configuration, resources, actions and authentication.

Documentation Tests Status PyPI Version Python Versions

Muffin-Admin

Requirements

  • Python 3.11 - 3.15
  • Muffin >= 3.1 and Muffin-REST >= 14.2
  • Peewee (muffin-peewee-aio) or SQLAlchemy Core (muffin-databases) for a storage backend

Install

pip install muffin-admin                # core
pip install "muffin-admin[peewee]"      # Peewee ORM
pip install "muffin-admin[sqlalchemy]"  # SQLAlchemy Core

Quickstart

from muffin_admin import Plugin, PWAdminHandler

admin = Plugin(app)


@admin.route
class UserResource(PWAdminHandler):
    """An admin resource for the User model."""

    class Meta(PWAdminHandler.Meta):
        model = User
        filters = "email", "is_active", "role"
        columns = "email", "is_active", "role", "created"

The admin is served at /admin and the resource API at /admin/api. See the quickstart for a complete application, including models and startup.

Features

  • List, create, edit and delete screens for Peewee ORM and SQLAlchemy Core resources
  • Filtering, sorting and pagination driven by Muffin-REST
  • Custom actions with forms, confirmation and file downloads
  • Dashboard cards and pluggable authorization hooks
  • Translations, custom CSS/JS and Material-UI icons

Documentation

Guide What it answers
Quickstart Build a working admin from scratch
Configuration Plugin options, config keys, environment variables
Resources AdminHandler.Meta in full
Custom actions Buttons, forms, files, confirmation
Authentication check_auth, login, storage, cookies
Dashboard Cards on the start page
Customization Translations, CSS/JS, mutation mode, frontend build
API reference Classes, options and hook signatures
Development Tests, examples, docs, release

Development

uv sync --all-extras --dev
uv run pytest tests     # tests
make lint               # pyrefly + ruff
make docs               # build the documentation
make example-peewee     # run the Peewee example

See Development for the full workflow.

Bug tracker and contributing

Issues and pull requests: https://github.com/klen/muffin-admin

License

MIT.

About

Admin interface for Muffin Framework

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

18 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0