phinity / django-admin-flex

A bootstrap-based frontend for the django admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Admin Flex

An admin theme for Django >= 1.6 setup for Bootstrap 3.

About

A set of Django Admin html templates curated for Bootstrap 3. Included is vanilla Bootstrap as well as a custom theme that is active by default to alleviate your fugly django-admin plight. Use your own Bootstrap theme to match the style of your front-end site (see customization instructions below).

Features

  • Rock solid admin templates that can be used with any Bootstrap theme
  • Two no-clutter themes included: "Bootstrap's Vanilla" and Bento-box (which can be activated by overriding the vanilla theme in admin/base_site.html)
  • Full/fluid width listing page for content heavy admins
  • Always-visible change form actions
  • No fuss: these templates will fit in nicely with your existing Django-admin workflow.

Install

Install with pip pip install django-admin-flex or pip install http://github.com/ofa/django-admin-flex

Add 'django_admin_flex', to your "INSTALLED_APPS" **before** 'django.contrib.admin'To customize the admin, create a new file in your django application'stemplatesfolder under the subfolderadmin/base_site.htmland paste in (then edit) the code found in the django-admin-flex `base_site.html`_ Customization ============= Enable template customizations by adding aTEMPLATE_DIRStuple to your settings file which points to a template directory where you would like any admin override templates to be located. For example atemplatesfolder in your root directory: .. code-block:: python TEMPLATE_DIRS = ( os.path.join(BASE_DIR, "templates"), ) Any html template added to theadmindirectory within your configuredtemplatesdirectory will override the default templates. It is recommended to create aadmin/base_site.htmlfile for basic customizations. Here is an example of that file: .. code-block:: html {% extends "admin/base.html" %} {% load i18n admin_static %} {% block title %}Site Admin{% endblock %} {% block footer_text %}Site Admin{% endblock %} To add a custom Bootstrap theme, point to your css file within thebootstrap_cssblock in yourbase_site.htmlfile. Here is an example that will use the alternative Bootstrap theme provided but you can use any Bootstrap theme you would like: .. code-block:: html {% block bootstrap_css %}{% static "css/your-bootstrap-theme.min.css" %}{% endblock %} There are many other blocks available in useful locations in the templates. Any other admin wide customizations can be made in yourbase_site.htmlfile while other specific pages can be overriden and/or extended. Issues and Contribution ======================= Contributions are highly encouraged. Please submit them as pull requests at the `Django Admin Flex GitHub Repository`_ Compiling django-admin-flex base CSS files ------------------------------------------ NPM, Bower and Grunt are used to compile a mininimal set of styles for the admin that Bootstrap doesn't handle. To compile any customizations made tostatic/less/main.lessorstatic/less/flex.less, run:npm installbower installgruntReporting an Issue ------------------ Feel free to report any issues or suggestions via github issues. Please include instruction for reproducing any issues - a screenshot may be helpful. Contributing ------------ Please make sure that all pull requests involving style changes include a compiled and minified version of any code you're changing. Updating theversioninsetup.py`` would also be appreciated.

Credits

Django Admin Flex was built in-house at Organizing for Action by Ben Korody and the source code is available on the Django Admin Flex GitHub Repository.

About

A bootstrap-based frontend for the django admin

License:MIT License


Languages

Language:HTML 92.2%Language:CSS 5.1%Language:JavaScript 2.3%Language:Python 0.4%