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
Python books free to read online or download

Python books free to read online or download

Paolo Amoroso 3.7k Jan 08, 2023
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
Awesome Video Datasets

Awesome Video Datasets

Yunhua Zhang 462 Jan 02, 2023
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
xarray: N-D labeled arrays and datasets

xarray is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun!

Python for Data 2.8k Dec 29, 2022
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
EOD (Easy and Efficient Object Detection) is a general object detection model production framework.

EOD (Easy and Efficient Object Detection) is a general object detection model production framework.

383 Jan 07, 2023
django-admin fixture generator command

Mockango for short mockango is django fixture generator command which help you have data without pain for test development requirements pip install dj

Ilia Rastkhadiv 14 Oct 29, 2022
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
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

215 Dec 31, 2022
Passhunt is a simple tool for searching of default credentials for network devices, web applications and more. Search through 523 vendors and their 2084 default passwords.

Passhunt is a simple tool for searching of default credentials for network devices, web applications and more. Search through 523 vendors and their 2084 default passwords.

Viral Maniar 1.1k Dec 31, 2022
A new style for Django admin

Djamin Djamin a new and clean styles for Django admin based in Google projects styles. Quick start Install djamin: pip install -e git://github.com/her

Herson Leite 236 Dec 15, 2022
There is a new admin bot by @sinan-m-116 .

find me on telegram! deploy me on heroku, use below button: If you can't have a config.py file (EG on heroku), it is also possible to use environment

Sinzz-sinan-m 0 Nov 09, 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 140 Oct 30, 2021
With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials.

Django Hijack With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials. Docs See http://django

1.2k Jan 05, 2023
Firebase Admin Console is a centralized platform for easy viewing and maintenance of Firestore database, the back-end API is a Python Flask app.

Firebase Admin Console is a centralized platform for easy viewing and maintenance of Firestore database, the back-end API is a Python Flask app. A starting template for developers to customize, build

Daqi Chen 1 Sep 10, 2022
Code to reproduce experiments in the paper "Task-Oriented Dialogue as Dataflow Synthesis" (TACL 2020).

Code to reproduce experiments in the paper "Task-Oriented Dialogue as Dataflow Synthesis" (TACL 2020).

Microsoft 274 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

1.6k Dec 28, 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
GFPGAN is a blind face restoration algorithm towards real-world face images.

GFPGAN is a blind face restoration algorithm towards real-world face images.

Applied Research Center (ARC), Tencent PCG 25.6k Jan 04, 2023