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
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
A user-friendly JSON editing form for Django admin

A user-friendly JSON editing form for Django admin

Bharat Chauhan 141 Dec 30, 2022
Freqtrade is a free and open source crypto trading bot written in Python

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram. It contains backtesting, plotting and money man

20.2k Jan 02, 2023
Lazymux is a tool installer that is specially made for termux user which provides a lot of tool mainly used tools in termux and its easy to use

Lazymux is a tool installer that is specially made for termux user which provides a lot of tool mainly used tools in termux and its easy to use, Lazymux install any of the given tools provided by it

DedSecTL 1.8k Jan 09, 2023
Helpers to extend Django Admin with data from external service with minimal hacks

django-admin-data-from-external-service Helpers to extend Django Admin with data from external service with minimal hacks Live demo with sources on He

Evgeniy Tatarkin 7 Apr 27, 2022
Real-time monitor and web admin for Celery distributed task queue

Flower Flower is a web based tool for monitoring and administrating Celery clusters. Features Real-time monitoring using Celery Events Task progress a

Mher Movsisyan 5.5k Dec 28, 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 09, 2022
A curated list of the latest breakthroughs in AI by release date with a clear video explanation, link to a more in-depth article, and code.

A curated list of the latest breakthroughs in AI by release date with a clear video explanation, link to a more in-depth article, and code

Louis-François Bouchard 2.9k Jan 08, 2023
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
Django application and library for importing and exporting data with admin integration.

django-import-export django-import-export is a Django application and library for importing and exporting data with included admin integration. Featur

2.6k Jan 07, 2023
A modern Python package manager with PEP 582 support.

A modern Python package manager with PEP 582 support.

Python Development Master(PDM) 3.6k Jan 05, 2023
DyStyle: Dynamic Neural Network for Multi-Attribute-Conditioned Style Editing

DyStyle: Dynamic Neural Network for Multi-Attribute-Conditioned Style Editing

74 Dec 03, 2022
A Django app that creates automatic web UIs for Python scripts.

Wooey is a simple web interface to run command line Python scripts. Think of it as an easy way to get your scripts up on the web for routine data anal

Wooey 1.9k Jan 01, 2023
手部21个关键点检测,二维手势姿态,手势识别,pytorch,handpose

手部21个关键点检测,二维手势姿态,手势识别,pytorch,handpose

Eric.Lee 321 Dec 30, 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
:honey_pot: A fake Django admin login screen page.

django-admin-honeypot django-admin-honeypot is a fake Django admin login screen to log and notify admins of attempted unauthorized access. This app wa

Derek Payton 907 Dec 31, 2022
Simple and extensible administrative interface framework for Flask

Flask-Admin The project was recently moved into its own organization. Please update your references to Flask-Admin 5.2k Dec 29, 2022

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 1.6k Dec 30, 2022
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.2k Dec 29, 2022
Tactical RMM is a remote monitoring & management tool for Windows computers, built with Django and Vue.

Tactical RMM is a remote monitoring & management tool for Windows computers, built with Django and Vue. It uses an agent written in golan

Dan 1.4k Dec 30, 2022