Code Monkey home page Code Monkey logo

django-admintools-bootstrap's Introduction

Django Admin Bootstrap theme

Twitter Bootstrap support for Django Admin. Requires django-admin-tools and mediagenerator packages. It also requires SASS to be installed.

This module started out life here:

https://bitbucket.org/salvator/django-admintools-bootstrap

I've developed it to fit into my preferred Django stack that includes mediagenerator and SASS. I've also updated to Bootstrap 3 and fixed a few bugs, as well as restyling things and including Glyphicons.

I'm currently trying to get this included as part of Django proper. Please star it if you would like to see it included as part of Django. Please remember that this is just a quick prototype and will be fully tested if accepted.

Screenshots

screen-shot-2013-10-29.png

screen-shot-2013-10-20.2.png

Features

  • Bootstrap 3
  • Much nicer widgets for images and dates
  • More responsive
  • Some nice icons
  • Dashboard
  • Cleaner javascript
  • Feincms tree editor support
  • Admin Widgets easier to extend with custom templates

Install

$ pip install -e hg+https://github.com/spenoir/django-admintools-bootstrap#egg=admintools_bootstrap
  • Insert admintools_bootstrap to your INSTALLED_APPS before admin_tools and django.contrib.admin apps.

  • Make sure you have static files application installed and configured. See https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/ for details.

  • add the following below where MEDIA_BUNDLES is set in your settings file:

    from admintools_bootstrap.settings import ADMIN_MEDIA_BUNDLES MEDIA_BUNDLES += ADMIN_MEDIA_BUNDLES

  • Enjoy.

Widgets

There are some custom widgets for your pleasure including a nice image widget I picked up and a bootstrap-datetimepicker.js implementation. To use these widgets, just subclass admintools_bootstrap.models.BootstrapModelAdmin in your admin.py files

from admintools_bootstrap.models import BootstrapModelAdmin

class ExampleAdmin(BootstrapModelAdmin): ...

Alternatively if you are already subclassing something else you can simply do it like this using formfield_overrides:

class ExampleModelAdmin(admin.ModelAdmin):

formfield_overrides = { DateTimeField: {'widget': BootstrapAdminSplitDateTime}, DateField: {'widget': BootstrapAdminDateWidget}, ImageField: {'widget': BootstrapAdminImageWidget},

}

Site name in navigation bar and title

admintools-bootstrap can use current site to display site name in admin interface.

To enable this feature, add django.contrib.sites to your INSTALLED_APPS list (if you have not yet).

Set site name and domain in django.contrib.sites admin.

Settings

Site link:

ADMINTOOLS_BOOTSTRAP_SITE_LINK = '/'

If not False, display specified link to site in the top panel

Media generator bundles are created for admin.js and admin.css.

Used software:

TODO

  • better mobile support
  • get rid of those green plus icons!
  • improve the dashboard views
  • reduce dependencies, in particular mediagenerator. Then just add support for it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.