Modern theme for Django admin interface

  • By Kaspars Sprogis
  • Last update: Dec 29, 2022
  • Comments: 17

Django Suit

Modern theme for Django admin interface.

Django Suit is alternative theme/skin/extension for Django administration interface.

License

Docs & Support

Changelog

Note: Django Suit v2.0 is in active development and not yet ready for production use.

Read more here: Todo: Add issue refernce

Contributing

See Contributing documentation

Build Status

Django Suit uses Travis CI to perform tests on different Django and Python versions.

Tested using Python: 2.7-3.4 and PyPy. Django: 1.9+ and Django Suit v2.0 alpha:

Build Status - v2 branch Build Status - develop branch

Preview

https://cloud.githubusercontent.com/assets/445304/12699480/3eee898e-c7c5-11e5-931c-ba1b0cabdecb.png

alt: Django Suit Preview :target: http://v2.djangosuit.com/admin/

Github

https://github.com/darklow/django-suit

Comments(17)

  • 1

    Django Suit rewrite on Bootstrap 3

    Few days ago i started Django suit rewrite on Bootstrap 3 and i will keep posting updates in this issue.

    Few previous notes about BS3 you can see here: https://github.com/darklow/django-suit/issues/134#issuecomment-39536028

    In nearest time i will push bs3 branch to github and you will be able to test it out. However it will be very early stage and it will be not ready for production for a while.

    Currently i am rewriting DS using Django 1.7 rc2 and hopefully i will be able to support both Django 1.6 and 1.7 version.

    New features

    • Two menu variations: Horizontal or vertical
    • Two color themes: Dark / Light theme
    • Configurable, properly aligned multi-column forms/fieldsets
    • and many more

    Sneak preview

    Few of new Django Suit design drafts (work in progress)

    suit2-vertical-dark

    Horizontal menu:

    suit2-horizontal-dark

    suit2-horizontal-light

  • 2

    Regression: SortableTabularInline re-ordering not persisting to db in v0.2.4

    This works in v0.2.3, and I'm guessing this commit may be the issue:

    https://github.com/darklow/django-suit/commit/435afaa7a0b0bab5cc0143557fdd312ea67f9f5d

    Full compare between versions: https://github.com/darklow/django-suit/compare/8f98158aa8c61dac11b03eb3e04fd6f989f531d7...22fbc800dcc069aade735d69d6ef164d31b35693

    Cheers :beers:

  • 3

    Date and Datetime field not show calendar

    Django 1.9.2 but i've tried to downgrade, i've the same issue. On DateField i can see the "today" link and the calendar ICON but on click not show calendar. I've tryed with and without Suit widget with the same result. Disabling suit it works normally.

    image

    image

    The html is loaded correectly but the JS is not "clickable" on the icon. if i call openCalendar() it works. image

  • 4

    Grid or Card view

    In some situations, for example when working with images or model objects that are strongly associated with images, the standard table view of Django admin app is less suitable. A Grid like view, where each model instance is rendered within defined rectangular boundaries, would be more appropriate and make better use of screen real estate. Using the fluid characteristics of Bootstrap such a layout would work quite well.

    Would you consider this a feature for Django Suit?

  • 5

    Warnings with 1.8 regarding settings.py templates

    I am getting the following issue:

    System check identified some issues:
    
    WARNINGS:
    ?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the \
    TEMPLATES dictionary takes precedence. You must put the values of the following settings into \
    your default TEMPLATES dict: TEMPLATE_CONTEXT_PROCESSORS.
    

    How can I declare my templates, my current settings.py are as follow:

    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': ['/home/mexicofan/mexicofan2015/static/templates'],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    'django.template.context_processors.debug',
                    'django.template.context_processors.request',
                    'django.contrib.auth.context_processors.auth',
                    'django.contrib.messages.context_processors.messages',
                ],
            },
        },
    ]
    

    ....

    from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
    
    TEMPLATE_CONTEXT_PROCESSORS = TCP + (
            'django.core.context_processors.request',
    )
    

    Also for some reason the admin templates are not shown on my admin but the regular site do.

  • 6

    django-mptt tree sortable

    I tried to follow the doc example for django-mptt tree sortable

    model.py

        class FooterLink(MPTTModel):
            link_text = models.CharField(max_length=120, blank=True,
                            help_text=_('With this field you can overwrite the title'
                                        ' that is displayed in the footer menu.'))
            page_link = PageField(null=True, blank=True,
                             related_name='footer_links')
            parent = TreeForeignKey('self', null=True,
                                    blank=True, related_name='children',
                                    verbose_name=_('Parent Link'))
            order = models.PositiveIntegerField()
    
            class MPTTMeta:
                order_insertion_by = ['order']
    
            def save(self, *args, **kwargs):
                super(FooterLink, self).save(*args, **kwargs)
                FooterLink.objects.rebuild()
    
            def __unicode__(self):
                if self.link_text:
                    return self.link_text
                if page_link:
                    page_link.get_page_title()
                return u'%s %s' % (self._meta.verbose_name.title(), self.pk)
    

    admin.py

        from django.contrib import admin
    
        from suit.admin import SortableModelAdmin
        from mptt.admin import MPTTModelAdmin
    
        from .models import FooterLink
    
        class FooterLinkAdmin(MPTTModelAdmin, SortableModelAdmin):
            mptt_level_indent = 20
            list_display = ('link_text', 'page_link')
            sortable = 'order'
    
        admin.site.register(FooterLink, FooterLinkAdmin)
    

    But its not being displayed correctly in django admin

    screen shot 2013-09-10 at 14 32 04

    Please Help

    [django-suit==0.2.4]

  • 7

    Change app name feature

    Add a config option to rename apps, e.g.

    SUIT_CONFIG = {
        ...
        'APP_NAMES': {
            'auth': "Users and Groups",
            'flatpages': "Static sites",
        },
        ...
    }
    
  • 8

    CSS not applied to admin panel.

    Hello Group,

    I finally got the admin panel sort of working. The css does not seem to be applied. Any clues?

    I created a demo user

    user: demo password: demo

    http://162.243.201.237/admin

    screen shot 2016-06-01 at 11 27 11 am

  • 9

    I see the demo,How the custom view show on?

    First thanks a lot to develop this repository!I have a question that how can I build custom view in django-suit?I see the demo have the example.But I don't know the source code to consult on,Can you help me?

    Thanks again!

  • 10

    Sortable issues

    Hi darklow,

    Thanks for django-suit! It's a nice admin theme and I appreciate your approach using Bootstrap. I am glad you're working on the Sortable feature, but unfortunately found two issues:

    • Using SortableTabularInline for inlines, if the main object does not extend SortableModelAdmin, the following exception occurs while editing an object:

    AttributeError: type object 'ModelForm' has no attribute 'Meta'

    in suit/admin.pu r.54: self.form.Meta.widgets[self.sortable] = SortableListForm.Meta.widgets[

    • Using SortableTabularInline with extra inlines (extra > 0), and submitting an object with empty 'extra' inlines:

    Form validation error on empty inline objects.

    .. probably because the SortableTabularInline sets the sortable field?

    Hope you can take a look at this!

  • 11

    Missing PNG/GIF icons in Django 1.9

    In Django 1.9, PNG and GIF admin icons were replaced with SVG icons (and therefore breaking IE8 compatibility, which Django now consider to be at end-of-life).

    This causes missing icons to be displayed in the admin for icons that are referenced by path. The only one of these I have been able to find so far is /static/admin/img/icon-unknown.gif but I'm sure there are more of these that have been affected.

    I guess this one might pose a bit of an issue if this project still supports IE8 although a simple fix could be to carry on with the if django_version < 1.9 pattern as in similar issues.

  • 12

    object-tools actions not rendered

    Hi there,

    after updating django from 3.1 to 3.2 buttons that usally are in object-tools does not rendered anymore. Moreover they are not appear even in the HTML

    Has someone the same problem? main content ui does not contains it anymore :(

  • 13

    Make django-suit compatible with Django 4.x.x

    In this commit an error:

    "django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'suit.templatetags.suit_menu': cannot import name 'ugettext_lazy' from 'django.utils.translation' python3.10/site-packages/django/utils/translation/init.py"

    has been fixed and now django-suit is compatible with Django version 4 by importing the gettext_lazy in admin_filters and menu files

  • 14

    Make django-suit compatible with Django 4.x.x

    In this commit an error:

    "django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'suit.templatetags.suit_menu': cannot import name 'ugettext_lazy' from 'django.utils.translation' python3.10/site-packages/django/utils/translation/init.py"

    has been fixed and now django-suit is compatible with Django version 4 by importing the gettext_lazy in admin_filters and menu files

  • 15

    Row styling failing silently?

    Seems row styling is failing. Code below does not result in any color changes and no errors that I can see. Python 3.7 and Django 1.18

        def suit_row_attributes(self, obj, request):
            logger.debug('color filler for %s', obj)
            try:
                css_class = {
                    True: 'warning',
                    False: '',
                }.get(obj.filler)
                if obj.filler is False:
                    css_class = {
                        True: 'success',
                        False: '',
                    }.get(obj.selected)
                if css_class:
                    return {'class': css_class}
            except AttributeError as err:
                logger.error('Cannot color filler - %s', err)
    
  • 16

    add subitems for the suit menu subitems(3 level tree)

    Is it Possible to structure a 3 level tree with django-suit menu? If yes how can I do this or if there is another way to customize in the menu. what i need is something like that:

    Main Menu| |- SubItem1 |- SubItem2 |- SubItem2-1 |- SubItem2-2 |- SubItem3

  • 17

    Minimum changes to make it work for Djnago 3.2

    These are the changes:

    • Fix imports and deprecated methods coming from Django.
    • Override and remove the navbar that has been introduced in Django 3.1
    • Fix styling issues:
      • Right filter in changelist not showing.
      • missing jquery library.

    I haven't updated the demo site at all. So there might be something to be fixed there.