Skip to main content

Tabler UI theme for Flask-Admin

Project description

flask-admin-tabler

A Tabler UI theme for Flask-Admin.

Installation

pip install flask-admin-tabler

Usage

Call theme.init_app(app) before creating the Admin instance so that the Tabler templates are registered with higher priority than Flask-Admin's default Bootstrap ones.

from flask import Flask
from flask_admin import Admin
from flask_admin_tabler import TablerTheme

app = Flask(__name__)
app.config["SECRET_KEY"] = "change-me"

theme = TablerTheme()
theme.init_app(app)          # must come before Admin(app, ...)

admin = Admin(app, name="My App", theme=theme)

That's it - navigating to /admin/ will now render the Tabler UI instead of the default Bootswatch theme.

A fully runnable example (including a SQLAlchemy model and sample data) is available in examples/quickstart.py:

pip install flask-admin-tabler flask-sqlalchemy
python examples/quickstart.py
# open http://127.0.0.1:5000/admin/

How it works

TablerTheme.init_app(app) registers a Flask blueprint named flask_admin_tabler that:

  1. Templates - exposes flask_admin_tabler/templates/tabler/ as a template folder. Because this blueprint is registered before Flask-Admin's admin blueprint, Flask resolves admin/base.html (and all other admin templates) from here first.
  2. Static files - serves the small amount of theme-specific CSS (e.g. admin/css/tabler/admin.css) at /static/flask_admin_tabler/.

Tabler's core CSS and JS are loaded from the jsDelivr CDN - no local copies needed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_admin_tabler-0.1.1.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_admin_tabler-0.1.1-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file flask_admin_tabler-0.1.1.tar.gz.

File metadata

  • Download URL: flask_admin_tabler-0.1.1.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_admin_tabler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c48d162089a11a6eca667dc4753891a7c293f681d5de2dcf36804d9c5dab1ad2
MD5 d9ea466d8716cb8aacc35ee79aabc5bc
BLAKE2b-256 7e2de283d3f7aa784dea48f7dfa83f548ddcd5e15cf5e83f8cdb374e8055e0d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_admin_tabler-0.1.1.tar.gz:

Publisher: new_release.yml on mariofix/flask-admin-tablerui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flask_admin_tabler-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_admin_tabler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 982db979ec140eed2addbdc025bab1953696821a8adee7127dc419eb8d0f8aac
MD5 cfbce91a18ebbf8251cd365df1d9653b
BLAKE2b-256 fb96d3ba67549c21f8e5deaced19b1c64f3718606fb6dbfe85e8b00c6e5c0c90

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_admin_tabler-0.1.1-py3-none-any.whl:

Publisher: new_release.yml on mariofix/flask-admin-tablerui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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