Django Semantic UI admin theme
Log in to the demo with username
django and password
Documentation is on GitHub Pages.
- Looks professional, with a nice sidebar.
- Responsive design, even tables can stack responsively on mobile.
- Semantic UI has libraries for React and Vue, in addition to jQuery. This means this package can be used to style the admin, and custom views can be added with React or Vue components with the same style.
Install from PyPI:
pip install django-semantic-admin
INSTALLED_APPS = [ "semantic_admin", "django.contrib.admin", ... ]
class ExampleStackedInline(admin.StackedInline): pass class ExampleTabularInline(admin.TabularInline): pass class ExampleAdmin(admin.ModelAdmin): inlines = (ExampleStackedInline, ExampleTabularInline)
Inherit from their
from semantic_admin import SemanticModelAdmin, SemanticStackedInline, SemanticTabularInline class ExampleStackedInline(SemanticStackedInline): pass class ExampleTabularInline(SemanticTabularInline): pass class ExampleAdmin(SemanticModelAdmin): inlines = (ExampleStackedInline, ExampleTabularInline)
Awesome optional features
- Optional integration with django_filter:
To enable this awesome feature, add
filter_class to your Django admin:
from semantic_admin.filters import SemanticFilterSet class DemoFilter(SemanticFilterSet): class Meta: model = Demo fields = ("demo_field",) class DemoAdmin(SemanticModelAdmin): filter_class = DemoFilter
- HTML preview in Django
To enable this awesome feature, add the
semantic_autocomplete property to your Django model:
class DemoModel(models.Model): @property def semantic_autocomplete(self): html = self.get_img() return format_html(html)
Install dependencies with
poetry install. The demo is built with invoke tasks. For example,
cd demo; invoke build.
Please note, this package uses Fomantic UI the official community fork of Semantic UI.