Skip to main content

Admin interface for Muffin Framework

Project description

https://raw.github.com/klen/muffin-admin/develop/.github/muffin-admin.png

Muffin-Admin – an extension to Muffin that implements admin-interfaces

Tests Status PYPI Version Python Versions

Features

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

custom_js_url

""

A link to custom JS file

custom_css_url

""

A link to custom CSS file

login_url

None

An HTTP URL for your custom authorization page

logout_url

None

An HTTP URL for your custom logout 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 Distribution

muffin-admin-0.22.3.tar.gz (649.6 kB view details)

Uploaded Source

Built Distribution

muffin_admin-0.22.3-py3-none-any.whl (651.2 kB view details)

Uploaded Python 3

File details

Details for the file muffin-admin-0.22.3.tar.gz.

File metadata

  • Download URL: muffin-admin-0.22.3.tar.gz
  • Upload date:
  • Size: 649.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for muffin-admin-0.22.3.tar.gz
Algorithm Hash digest
SHA256 54e6d2fdd32ef9b0b8b223ffd7f0f92a48d2933075c1d9742893506f9e2cf926
MD5 1b598fe5bf723e1a5749d71f122ad97e
BLAKE2b-256 03658e07faab1234f7261352528778649a6bfe4c885550f760df514ac35660da

See more details on using hashes here.

File details

Details for the file muffin_admin-0.22.3-py3-none-any.whl.

File metadata

  • Download URL: muffin_admin-0.22.3-py3-none-any.whl
  • Upload date:
  • Size: 651.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for muffin_admin-0.22.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c25b6d98a388585e10a26c31cf2fe4e255318485fdf384bcd6a96c605df4762d
MD5 51b1a9066f96c432eefa9dd881d7ea80
BLAKE2b-256 5dc9bab30e12147285ba55d56794d86742446b8246e704bfb10deb5f2e7bc3ae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page