Skip to main content

Django Semantic UI Admin theme

Project description

Django Semantic UI admin theme

django-semantic-admin

A completely free (MIT) Semantic UI admin theme for Django. Actually, this is my 3rd admin theme for Django. The first was forgettable, and the second was with Pure CSS. Pure CSS was great, but lacked JavaScript components.

Semantic UI looks professional, and has great JavaScript components.

Log in to the demo with username admin and password semantic: https://semantic-admin.com

Documentation is on GitHub Pages.

Django Semantic Forms

🎉 As of v0.5.0, forms were moved to django-semantic-forms. semantic_forms must be added to INSTALLED_APPS.

INSTALLED_APPS = [
    "semantic_admin",
    "semantic_forms",
    ...
]

You may use semantic_forms outside of the admin.

Why?

  • Looks professional, with a nice sidebar.
  • Responsive design, even tables can stack responsively on mobile.
  • JavaScript datepicker and timepicker components.
  • JavaScript selects, including multiple selections, which integrate well with Django autocomplete fields.
  • 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

Install from PyPI:

pip install django-semantic-admin

Add to settings.py before django.contrib.admin:

INSTALLED_APPS = [
    "semantic_admin",
    "semantic_forms",
    "django.contrib.admin",
    ...
]

Please remember to run python manage.py collectstatic for production deployments.

Usage

Instead of admin.ModelAdmin, admin.StackedInline, or admin.TabularInline:

class ExampleStackedInline(admin.StackedInline):
    pass

class ExampleTabularInline(admin.TabularInline):
    pass

class ExampleAdmin(admin.ModelAdmin):
    inlines = (ExampleStackedInline, ExampleTabularInline)

Inherit from their Semantic equivalents:

from semantic_admin import SemanticModelAdmin, SemanticStackedInline, SemanticTabularInline

class ExampleStackedInline(SemanticStackedInline):
    pass

class ExampleTabularInline(SemanticTabularInline):
    pass

class ExampleAdmin(SemanticModelAdmin):
    inlines = (ExampleStackedInline, ExampleTabularInline)

Awesome optional features

  1. Optional integration with django-filter:
django-filter

To enable this awesome feature, add filterset_class to your Django admin:

from semantic_forms.filters import SemanticFilterSet

class DemoFilter(SemanticFilterSet):
    class Meta:
        model = Demo
        fields = ("demo_field",)

class DemoAdmin(SemanticModelAdmin):
    filterset_class = DemoFilter
  1. HTML preview in Django autocomplete_fields:
html5-autocomplete

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)
  1. Optional integration with django-import-export:
django-import-export

To enable this awesome feature, instead of ImportExportModelAdmin, etc:

from import_export.admin import ImportExportModelAdmin 

class ExampleImportExportAdmin(ImportExportModelAdmin):
    pass

Inherit from their Semantic equivalents:

from semantic_admin.contrib.import_export.admin import SemanticImportExportModelAdmin

class ExampleImportExportAdmin(SemanticImportExportModelAdmin):
    pass

Contributing

Install dependencies with poetry install. The demo is built with invoke tasks. For example, cd demo; invoke build.

Notes

Please note, this package uses Fomantic UI the official community fork of Semantic UI.

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

django_semantic_admin-0.6.5.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

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

django_semantic_admin-0.6.5-py3-none-any.whl (79.0 kB view details)

Uploaded Python 3

File details

Details for the file django_semantic_admin-0.6.5.tar.gz.

File metadata

  • Download URL: django_semantic_admin-0.6.5.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for django_semantic_admin-0.6.5.tar.gz
Algorithm Hash digest
SHA256 fcc9fb4df705a3bf5438a322209d64e56d353271ff4efc486397de96d095610c
MD5 d41971183a4228299e96b3e4c3bd70ce
BLAKE2b-256 6a7816704b9df8e98738b8c84797b0c31793028c47689fa792b74c883c5f0359

See more details on using hashes here.

File details

Details for the file django_semantic_admin-0.6.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_semantic_admin-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 aec7c63d3f1327bb8736537673b5f8d4feb7bfca06871e1acd1ebc66ef479acb
MD5 15b429a4688a5c435e4841c16ce8eba3
BLAKE2b-256 f10600a8f777c41c47de411a8b53a5a5350f79be637535d5fe37762fdd8ffa18

See more details on using hashes here.

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