Admin interface for Muffin Framework
Project description
Muffin-Admin – an extension to Muffin that implements admin-interfaces
Features
Support for Peewee ORM, Mongo, SQLAlchemy Core through Muffin-Rest;
Automatic filtering and sorting for items;
Requirements
python >= 3.7
Installation
Muffin-Admin should be installed using pip:
pip install muffin-admin
With SQLAlchemy Core support:
pip install muffin-admin[sqlalchemy]
With Peewee ORM support:
pip install muffin-admin[peewee]
Usage
Initialize the admin:
from muffin_admin import Plugin
admin = Plugin(**options)
Initialize admin handlers (example for Peewee ORM):
from muffin_admin import PWAdminHandler
@admin.route
class UserResource(PWAdminHandler):
"""Create Admin Resource for the User model."""
class Meta:
"""Tune the resource."""
# Peewee Model for the admin resource
model = User
# Filters
filters = 'email', 'created', 'is_active', 'role'
# Tune serialization/deserialization schemas
schema_meta = {
'load_only': ('password',),
'dump_only': ('created',),
}
# Columns to show
columns = 'id', 'email', 'is_active', 'role', 'created'
# Custom Material-UI icon
icon = 'People'
Connect admin to an Muffin application:
admin.setup(app, **options)
For futher reference check https://github.com/klen/muffin-admin/tree/develop/examples <examples> in the repository.
Configuration options
Name |
Default value |
Description |
prefix |
"/admin" |
Admin’s HTTP URL prefix |
title |
"Muffin Admin" |
Admin’s title |
auth_redirect_url |
None |
Admin’s HTTP URL for your custom authorization page |
auth_storage |
"localstorage" |
Where to keep authorization information (localstorage|cookies) |
auth_storage_name |
muffin_admin_auth |
Localstorage/Cookie name for authentication info |
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-admin/issues
Contributing
Development of Muffin-Admin happens at: https://github.com/klen/muffin-admin
Contributors
klen (Kirill Klenov)
License
Licensed under a MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file muffin_admin-0.21.0-py3-none-any.whl
.
File metadata
- Download URL: muffin_admin-0.21.0-py3-none-any.whl
- Upload date:
- Size: 652.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6cd26ad874cedf00da9b0a4defd2ef18df7bb339d691dec0d914d36097a01cd |
|
MD5 | bcee421013136264563f066ce117923f |
|
BLAKE2b-256 | b63f388cddb6429db15189c91af0156df75888bc7c49b666ddfa6b1570019d59 |