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.

Issues
  • Do not support Django1.9 !

    Do not support Django1.9 !

    jquery file not found

    opened by denis-sukhoverkhov 11
  • 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
  • django 1.11 compatibility

    django 1.11 compatibility

    Starting an issue to get a discussion on Django 1.11 compatibility going

    version compatibility 
    opened by eskhool 9
  • Compatibility with Django 1.6

    Compatibility with Django 1.6

    opened by douglasmiranda 8
  • 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
  • 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
  • default errorlist class is not styled

    default errorlist class is not styled

    When raising a form validation error for instance, the generated html has an errorlist class. This class is not styled in red.

    bug 
    opened by gustavosoares 7
  • admin page layout confusion..

    admin page layout confusion..

    2017-04-19 10 44 24 like this . i think is the css file somehow blow out... please help me thanks !

    opened by Ehco1996 6
  • 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
  • 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 0
  • workning fine in django 3

    workning fine in django 3

    i'm tring the lib into django 3 and it works fine until now,maby could add the support into the description

    opened by mzramna 0
  • 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
  • use local static file

    use local static file

    use local static file

    opened by jhao104 0
  • Works with django server but not with Apache mod_wsgi

    Works with django server but not with Apache mod_wsgi

    It complains about django is not defined and (django.jQuery) is highlighted in index.html Its weird as it works fine when using Django dev server. Any idea? static files are missing when collected? Using Django 2.2 and Python 3.6

    opened by Brazze66 1
  • Accessibility of the dashboard

    Accessibility of the dashboard

    We will start to work on that when this starts: #119

    opened by douglasmiranda 0
  • Maybe remove custom style for datefield calendar

    Maybe remove custom style for datefield calendar

    The current one is responsive.

    opened by douglasmiranda 1
  • Last inline not displayed, if has_add_permission returns False

    Last inline not displayed, if has_add_permission returns False

    Lets have following simple test application: models.py:

    from django.db import models
    
    class Parent(models.Model):
        name = models.CharField(max_length=20)
    
    class Child(models.Model):
        parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
        name = models.CharField(max_length=20)
    

    admin.py:

    from django.contrib import admin
    
    from .models import Child, Parent
    
    
    class ChildInlineAdmin1(admin.TabularInline):
        model = Child
    
        def has_add_permission(self, request):
            return False
    
    
    class ChildInlineAdmin2(admin.TabularInline):
        model = Child
    
    
    class ParentAdmin(admin.ModelAdmin):
        inlines = (ChildInlineAdmin1, ChildInlineAdmin2)
    
    
    admin.site.register(Parent, ParentAdmin)
    

    The first Inline admin doesn't show the last child.

    opened by misli 4
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.6(Sep 4, 2016)

  • 0.3.1(Sep 4, 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)
Owner
Douglas Miranda
Turning ideas into code.
Douglas Miranda
Collection of admin fields and decorators to help to create computed or custom fields more friendly and easy way

django-admin-easy Collection of admin fields, decorators and mixin to help to create computed or custom fields more friendly and easy way Installation

Ezequiel Bertti 328 Oct 15, 2021
Responsive Theme for Django Admin With Sidebar Menu

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

Douglas Miranda 812 Sep 29, 2021
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 638 Oct 11, 2021
WordPress look and feel for Django administration panel

Django WP Admin WordPress look and feel for Django administration panel. Features WordPress look and feel New styles for selector, calendar and timepi

Maciej Marczewski 259 Sep 13, 2021
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 406 Oct 15, 2021
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 33 Oct 18, 2021
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 295 Sep 9, 2021
📱 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 Jul 28, 2021
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 813 Oct 23, 2021
Material design for django administration

Django Material Administration Quick start pip install django-material-admin Add material.admin and material.admin.default to your INSTALLED_APPS sett

Anton 222 Oct 18, 2021
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.2k Oct 18, 2021
An administration website for Django

yawd-admin, a django administration website yawd-admin now has a live demo at http://yawd-admin.yawd.eu/. Use demo / demo as username & passowrd. yawd

Pantelis Petridis 139 Jul 27, 2021
Extendable, adaptable rewrite of django.contrib.admin

django-admin2 One of the most useful parts of django.contrib.admin is the ability to configure various views that touch and alter data. django-admin2

Jazzband 1.1k Oct 19, 2021
Legacy django jet rebooted , supports only Django 3

Django JET Reboot Rebooting the original project : django-jet. Django Jet is modern template for Django admin interface with improved functionality. W

null 41 Oct 9, 2021
fastapi-admin is a fast admin dashboard based on FastAPI and TortoiseORM with tabler ui, inspired by Django admin.

fastapi-admin is a fast admin dashboard based on FastAPI and TortoiseORM with tabler ui, inspired by Django admin.

fastapi-admin 912 Oct 14, 2021
Django Smuggler is a pluggable application for Django Web Framework that helps you to import/export fixtures via the automatically-generated administration interface.

Django Smuggler Django Smuggler is a pluggable application for Django Web Framework to easily dump/load fixtures via the automatically-generated admin

semente 359 Sep 28, 2021
Extendable, adaptable rewrite of django.contrib.admin

django-admin2 One of the most useful parts of django.contrib.admin is the ability to configure various views that touch and alter data. django-admin2

Jazzband 1.1k Oct 15, 2021
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 1k Oct 14, 2021
Visually distinguish environments in Django Admin

django-admin-env-notice Visually distinguish environments in Django Admin. Based on great advice from post: 5 ways to make Django Admin safer by hakib

Yuri Shikanov 228 Oct 15, 2021