Responsive Theme for Django Admin With Sidebar Menu

Overview

Responsive Django Admin

If you're looking for a version compatible with Django 1.8 just install 0.3.7.1.

Features

  • Responsive
  • Sidebar Menu
  • Easy install / setup
  • Support Django 1.11, 2.1, 2.2 and 3.0
  • Bootstrap 3
  • Python 3

Screenshots

See Screenshots

More screenshots

INSTALL

from pypi (recommended)

$ pip install bootstrap-admin

And don't forget to add bootstrap_admin in INSTALLED_APPS before the django.contrib.admin.

Example:

INSTALLED_APPS = (
    # ...
    'bootstrap_admin', # always before django.contrib.admin
    'django.contrib.admin',
    # ...
)

CUSTOMIZE

Sidebar Menu

It is enabled by default. But if you remove django.template.context_processors.request from your context_processors.

Just disable it:

BOOTSTRAP_ADMIN_SIDEBAR_MENU = False

Branding - Overriding logo

If you want to use your own logo, you can achieve this by overriding the login.html and base_site.html, just like in Django Admin.

First, make sure the TEMPLATES setting in your settings.py is properly configured:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'my_django_project/templates')],
        'APP_DIRS': True,
        # other stuff
    },
]

DIRS: You must set the location of your templates, an absolute path.

I'm assuming BASE_DIR is:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

This pattern of creating a global templates folder could be useful for you to use for your base.html and other global templates.

More info: https://docs.djangoproject.com/en/2.1/ref/templates/api/#configuring-an-engine

Let me show you a project structure as an example:

├── my_django_project
│   ├── core
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── models.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── settings.py
│   ├── templates
│   │   └── admin
│   │       ├── base_site.html
│   │       └── login.html
│   ├── urls.py
│   └── wsgi.py
├── manage.py

You can see I created a global templates/ folder, with another directory inside admin/ containing login.html and base_site.html.

Their respective contents are:

base_site.html

{% extends 'admin/base_site.html' %}
{% load static %}

{% block branding %}
    <a href="{% url 'admin:index' %}" class="django-admin-logo">
        <!-- Django Administration -->
        <img height="60" src="{% static "bootstrap_admin/img/logo-140x60.png" %}" alt="{{ site_header|default:_('Django administration') }}">
    </a>
{% endblock branding %}

login.html

{% extends 'admin/login.html' %}
{% load i18n static %}

{% block branding %}
    <a href="{% url 'admin:index' %}" class="django-admin-logo">
        <!-- Django Administration -->
        <img height="60" src="{% static "bootstrap_admin/img/logo-140x60.png" %}" alt="{{ site_header|default:_('Django administration') }}">
    </a>
{% endblock branding %}

More info: https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#admin-overriding-templates

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request =]

See the full list of contributors.

Open an issue if you find a bug or want something more.

Comments
  • How do you feel about bootstrap-select2 and bootstrap-fileinput?

    How do you feel about bootstrap-select2 and bootstrap-fileinput?

    I have made a custom css (based on django-bootstrap-admin) and felt there was something wrong with file-inputs and dropdowns. So I added support for https://fk.github.io/select2-bootstrap-css/master.html and https://github.com/kartik-v/bootstrap-fileinput (in their simplest form - see screenshot).

    Would you be interested in a PR with those 2 libraries integrated into this project?

    image image

    enhancement 
    opened by nanuxbe 9
  • Six removed from django 3.0

    Six removed from django 3.0

    Hello thanks for your work, the library django.utils.six was removed from django 3.0

    https://docs.djangoproject.com/en/3.0/releases/3.0/#removed-private-python-2-compatibility-apis

      File "django_projects/Asostartups/venv/lib/python3.7/site-packages/bootstrap_admin/templatetags/bootstrap_admin_template_tags.py", line 5, in <module>
        from django.utils import six
    ImportError: cannot import name 'six' from 'django.utils' (/Users/carlosortegon/django_projects/Asostartups/venv/lib/python3.7/site-packages/django/utils/__init__.py)
    
    During handling of the above exception, another exception occurr
    
    opened by ortegoncarlos 7
  • Not Found Code 404 for static/admin/js/prepopulate_init.js and static/admin/js/change_form.js

    Not Found Code 404 for static/admin/js/prepopulate_init.js and static/admin/js/change_form.js

    Hello,

    I'm getting status not found for these js files:

    static/admin/js/change_form.js and static/admin/js/prepopulate_init.js just looked on source code for django 1.9.8 and these files does not exist.

    What am I missing here?

    Please help!

    opened by asilvino 7
  • submenu overlaps top menu items

    submenu overlaps top menu items

    The submenu with search and filter that is "sticky" (stays on top when you scroll down), stays above the main top fixed menu (meaning any dropdowns in the main menu are hidden by the filter menu when opened).

    ext 
    opened by marc-gist 6
  • select all is not working in change_list

    select all is not working in change_list

    Dear Sir, This is a awesome project and I like it. After play around, I suddenly found in the list view, the select all checkbox is not working? is it a bug or just happened on me? my version is bootstrap-admin (0.3.9)

    Thanks for any help

    opened by myereach 5
  • compatibility with Django 2.0

    compatibility with Django 2.0

    To ensure Django 2.0 compatibility, in the bootstrap_admin_template_tags.py the import

    from django.core.urlresolvers import reverse, NoReverseMatch
    

    should be changed to

    from django.urls import reverse, NoReverseMatch
    

    because Django 2.0 removed the django.core.urlresolvers module (moved to django.urls with Django 1.10).

    opened by vpodpecan 5
  • Should we make the admin header and title be configurable for example of grappelli?

    Should we make the admin header and title be configurable for example of grappelli?

      #settings.py
    
      ADMIN_TITLE = "Django Admin"
    
      ADMIN_BRAND_TITLE = "Django Admin"
    
      ......
    

    As django 1.7 + has the feature of customizing the AdminSite conveniently,should we add the feature such as set the admin title in settings.py

    opened by zchking 5
  • No module named apps

    No module named apps

    from django.apps import apps
    
    'bootstrap_admin_template_tags' is not a valid tag library: ImportError raised loading bootstrap_admin.templatetags.bootstrap_admin_template_tags: No module named apps
    

    branch django1.7_bootstrap_3

    opened by nordbit 5
  • Bug in displaying Recent Actions

    Bug in displaying Recent Actions

    Recent Actions contains a bug. When I add a data for a model, the recent actions is not showing the value returned from __str__() method of the model. Instead it shows like Person object(101), Employee object(121). But I see your screenshot displaying Document 1. Why is that happening? Whats the problem actually? I'm using Django 2.0.

    ss

    opened by binaryblood 4
  • Collapse class does not work properly with StackedInline

    Collapse class does not work properly with StackedInline

    So the topic describes everything we need.

    class FooAdminInline(StackedInline): classes = ['collapse'] does not works properly - "show" button does not displayed, but form and everything hidden. Reason is different ways of edit_inline/stacked.html template in original Django admin templates and bootsrap_admin. Original - https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/edit_inline/stacked.html Bootstrap - https://github.com/douglasmiranda/django-admin-bootstrap/blob/master/bootstrap_admin/templates/admin/edit_inline/stacked.html

    opened by ko1es 4
  • The raw_id_fields doesn't work

    The raw_id_fields doesn't work

    like this, when do not use the raw_id_fields image the page show this: image but when use the raw_id_fields: image the page show nothing, just a text: image so, what wrong in this?

    version compatibility 
    opened by c4x 4
  • "Invalid block tag on line 132: 'ifequal', expected 'endblock'. Did you forget to register or load this tag?"

    Fresh install on a fresh (empty) Django project, did everything based on tutorial here.

    <html>
    <body>
    <!--StartFragment-->
    
    122 | <div class="{% if action_form and actions_on_bottom and cl.full_result_count %}col-sm-8{% else %}col-sm-12{% endif %}">
    -- | --
    {% block pagination %}{% pagination cl %}{% endblock %}
    </div>
    </div>
    </div>
    {% endif %}
    {% endblock %}
    <div class="panel-footer" id="panel-footer">
    <span class="info pull-left">
    {{ cl.result_count }}
    {% ifequal cl.result_count 1 %}
    {{ cl.opts.verbose_name }}
    {% else %}
    {{ cl.opts.verbose_name_plural }}
    {% endifequal %}
    </span>
    <div class="right-buttons">
    <a href="#panel-heading" class="btn btn-default btn-xs" role="button">
    <span class="glyphicon glyphicon-chevron-up"></span>
    </a>
    {% if cl.formset and cl.result_count %}
    
    <!--EndFragment-->
    </body>
    </html>
    
    opened by adhdisdev 2
  • Actions don't display with django 3.2

    Actions don't display with django 3.2

    The changelist actions stopped showing correctly when upgrading to Django 3.2 (perhaps Django 3.x?). After some scouring, I've found the following need to be overridden to make them work:

    In templates/admin/change_list.html add the following css override to revert a css change made by this library:

    {% extends "admin/change_list.html" %}
    {% load i18n admin_urls static admin_list %}
    
    {% block extrastyle %}
      {{ block.super }}
      <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
      {% if cl.formset %}
        <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
      {% endif %}
      {% if cl.formset or action_form %}
        <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
      {% endif %}
      {{ media.css }}
      {% if not actions_on_top and not actions_on_bottom %}
        <style>
          #changelist table thead th:first-child {width: inherit}
        </style>
      {% endif %}
      <style>
        #changelist .actions span.all,
        #changelist .actions span.action-counter,
        #changelist .actions span.clear,
        #changelist .actions span.question {
          display: inline-block;
          font-size: 13px;
          margin: 0 0.5em;
        }
      </style>
    {% endblock %}
    

    and in templates/admin/actions.html add the following to set the actions to default hidden:

    {% load i18n bootstrap_admin_template_tags %}
    <div class="actions">
      {% for field in action_form.visible_fields %}
        <div class="input-group" title="{{ field.label }}">
          {{ field|add_class:'form-control' }}
          <span class="input-group-btn">
            <button type="submit" class="btn btn-default" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>
          </span>
        </div>
      {% endfor %}
      {% for field in action_form.hidden_fields %}{{field}}{% endfor %}
    
      {% if actions_selection_counter %}
        <div class="info-actions">
          <span class="action-counter label label-info" data-actions-icnt="{{ cl.result_list|length }}">{{ selection_note }}</span>
          {% if cl.result_count != cl.result_list|length %}
            <span class="all hidden label label-info">{{ selection_note_all }}</span>
            <span class="question hidden label label-primary">
                <a href="#" title="{% trans "Click here to select the objects across all pages" %}"><span class="glyphicon glyphicon-check"></span> {% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
            </span>
            <span class="clear hidden label label-warning"><a href="#"><span class="glyphicon glyphicon-unchecked"></span> {% trans "Clear selection" %}</a></span>
          {% endif %}
        </div>
      {% endif %}
    </div>
    
    opened by jasonbodily 1
  • not loading static files on django2.2

    not loading static files on django2.2

    i installed the repo with pip but when i go to the admin url it does not load all the static files and my ui does not show properly, how do i install these files?. thanks

    opened by NitaiFraire 1
  • replace is_staff with has_permission

    replace is_staff with has_permission

    Hello, @douglasmiranda

    https://github.com/douglasmiranda/django-admin-bootstrap/blob/1c837e39e2beaf309398e648c174125189394130/bootstrap_admin/templates/admin/base.html#L125

    in above line we shouldn't check accessibility with "is_staff". this cause problems for customized permission admin sites.

    we should replace that line with: {% if has_permission %}

    opened by pprolancer 0
Releases(0.4.4)
  • 0.4.4(Jun 3, 2020)

  • 0.4.3(Apr 3, 2019)

    We adopted a CODE OF CONDUCT. xD

    We're using Bootstrap 3, we'll start to work on a Bootstrap upgrade.

    And I'm more excited about this!!!

    Changes for this release:

    • Change "Recent Actions" to "Apps" on the apps table
    • Fix string not being able to translate because of title-case
    • Instead of "My Actions" show the name/username of the current user
    • Avoiding the overflow of links in forms; Not applying to .main a anymore because it can touch in links you don't want break-all
    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Mar 17, 2019)

    Thanks, @dlareau for #139 xD

    Some improvements are:

    • Using context var app_list from Django Admin and not from our custom template tag.
    • Custom template tag and custom template for sidebar removed, it's more simple now.
    • available_apps now provides us a way to render the app list everywhere on Django Admin.

    For more: #54 #140 #141

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Mar 4, 2019)

    Some improvements:

    • Fix sidebar menu too small in some screens #129
    • Sidebar Filters are now collapsable #133
    • Fix misaligned icons for related field
    • Fix style of autocomplete widget
    • Fix errors not highlighted for multiple fields per line
    • Fix misaligned Checkboxes
    • Small CSS fixes

    Big thanks to R.J. van Lierop for making django-admin-bootstrap better!

    I've been testing on Django 2.2 Beta, it looks like we're going to be just fine, no big changes so far.

    If you find any issues with Django 2.2 Beta, please tell me.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Aug 31, 2018)

    Why Paulino & Mackenzie?

    Open source it's not an easy endeavor, most of the time contributors don't receive the appreciation they deserve, so I'll be dedicating every release of my projects to a contributor that made a PR in that release or someone from past releases. It's a small gesture, I intend to do more, but I feel it's a good start.

    So thanks @gilsonbp and @cmackenziek for your contributions.

    In this release we have:

    • Better (readme) docs
    • A better way to handle branding of the dashboard
    • Some other additional info
    • New MIT licensing
    Source code(tar.gz)
    Source code(zip)
  • 0.3.9(Jan 29, 2018)

    Now with Django 2.0 support #112.

    Note I'm only officially supporting 1.11 and 2.0. It's hard to support many versions.

    Need more contributors. =/

    There was a problem with StackedInline #116, but it's fixed now 4b31f1ddce29b2ad2d1cb38bc53c7d0a422b8f55.

    Source code(tar.gz)
    Source code(zip)
  • 0.3.8(Dec 1, 2017)

    So, after a hiatus I'm back releasing this package with Django 1.11 support.

    I no longer support older versions of Django, we need to move forward and Django 1.11 it's the new LTS, folks using Django 1.18 need to upgrade. April, 2018 ends support for 1.8.

    I hope you like the improvements:

    • Now supporting Django 1.11 (end support for older versions)
    • Ability to specify custom classes for admin inline fields
    • Removing (almost all) javascript code from templates
    • Using CDN for bootstrap files
    • Fix widgets not rendering correctly:
      • related lookup, add and change links
      • split datetime
      • raw id fields
      • file field
      • url field
    • Now sidebar menu is enabled by default
    Source code(tar.gz)
    Source code(zip)
  • 0.3.7.1(Sep 6, 2016)

  • 0.3.7(Sep 4, 2016)

    0.3.7 Sep 4, 2016

    • Better compatibility with latest Django
    • Python 3 fix #86
    • Upgrade to Bootstrap v3.3.7
    • Fix some minor bugs

    I want to thank all these awesome people:

    • (@ejnens)
    • Stéphane Angel (@twidi)
    • Gustavo Soares (@gustavosoares)
    • @alrusdi
    • Evan Borgstrom (@borgstrom)
    • James Pic (@jpic)
    • Silvano Nogueira (@snbuback)
    • Emmanuelle Delescolle (@nanuxbe)
    • Petar (@pbojinov)
    • Sergii Lapin (@Seha16)
    • Oria (@oriadam)
    • Jan Schär (@jscissr)
    • Adam Jakubowski (@ajakubo1)
    • Simone Tombesi (@Seether85)
    • Mauricio (@maoaiz)
    • Michael Kutý (@michaelkuty)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.6(Sep 4, 2016)

  • 0.3.1(Sep 4, 2016)

Owner
Douglas Miranda
Turning ideas into code.
Douglas Miranda
Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo

Django JET Modern template for Django admin interface with improved functionality Attention! NEW JET We are proud to announce completely new Jet. Plea

Geex Arts 3.4k Dec 29, 2022
A cool, modern and responsive django admin application based on bootstrap 5

django-baton A cool, modern and responsive django admin application based on bootstrap 5 Documentation: readthedocs Live Demo Now you can try django-b

Otto srl 678 Jan 1, 2023
Extends the Django Admin to include a extensible dashboard and navigation menu

django-admin-tools django-admin-tools is a collection of extensions/tools for the default django administration interface, it includes: a full feature

Django Admin Tools 731 Dec 28, 2022
A Django admin theme using Twitter Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed apps.

django-admin-bootstrapped A Django admin theme using Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed ap

null 1.6k Dec 28, 2022
Modern theme for Django admin interface

Django Suit Modern theme for Django admin interface. Django Suit is alternative theme/skin/extension for Django administration interface. Project home

Kaspars Sprogis 2.2k Dec 29, 2022
A Django admin theme using Twitter Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed apps.

django-admin-bootstrapped A Django admin theme using Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed ap

null 1.6k Dec 28, 2022
A flat theme for Django admin interface. Modern, fresh, simple.

Django Flat Theme django-flat-theme is included as part of Django from version 1.9! ?? Please use this app if your project is powered by an older Djan

elky 416 Sep 22, 2022
Modern theme for Django admin interface

Django Suit Modern theme for Django admin interface. Django Suit is alternative theme/skin/extension for Django administration interface. Project home

Kaspars Sprogis 2.2k Dec 29, 2022
Django Semantic UI admin theme

Django Semantic UI admin theme A completely free (MIT) Semantic UI admin theme for Django. Actually, this is my 3rd admin theme for Django. The first

Alex 69 Dec 28, 2022
Jet Bridge (Universal) for Jet Admin – API-based Admin Panel Framework for your application

Jet Bridge for Jet Admin – Admin panel framework for your application Description About Jet Admin: https://about.jetadmin.io Live Demo: https://app.je

Jet Admin 1.3k Dec 27, 2022
aiohttp admin is generator for admin interface based on aiohttp

aiohttp admin is generator for admin interface based on aiohttp

Mykhailo Havelia 17 Nov 16, 2022
📱 An extension for Django admin that makes interface mobile-friendly. Merged into Django 2.0

Django Flat Responsive django-flat-responsive is included as part of Django from version 2.0! ?? Use this app if your project is powered by an older D

elky 248 Sep 2, 2022
An improved django-admin-tools dashboard for Django projects

django-fluent-dashboard The fluent_dashboard module offers a custom admin dashboard, built on top of django-admin-tools (docs). The django-admin-tools

django-fluent 326 Nov 9, 2022
A Django app for easily adding object tools in the Django admin

Django Object Actions If you've ever tried making admin object tools you may have thought, "why can't this be as easy as making Django Admin Actions?"

Chris Chang 524 Dec 26, 2022
Disable dark mode in Django admin user interface in Django 3.2.x.

Django Non Dark Admin Disable or enable dark mode user interface in Django admin panel (Django==3.2). Installation For install this app run in termina

Artem Galichkin 6 Nov 23, 2022
Jazzy theme for Django

Django jazzmin (Jazzy Admin) Drop-in theme for django admin, that utilises AdminLTE 3 & Bootstrap 4 to make yo' admin look jazzy Installation pip inst

David Farrington 1.2k Jan 8, 2023
Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.

Xadmin Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap. Liv

差沙 4.7k Dec 31, 2022
A jazzy skin for the Django Admin-Interface (official repository).

Django Grappelli A jazzy skin for the Django admin interface. Grappelli is a grid-based alternative/extension to the Django administration interface.

Patrick Kranzlmueller 3.4k Dec 31, 2022
django's default admin interface made customizable. popup windows replaced by modals. :mage: :zap:

django-admin-interface django-admin-interface is a modern responsive flat admin interface customizable by the admin itself. Features Beautiful default

Fabio Caccamo 1.3k Dec 31, 2022