Django WP Admin¶
WordPress look and feel for Django administration panel.¶
Features¶
- WordPress look and feel
- New styles for selector, calendar and timepicker widgets
- More responsive (admin panel should look fine and be usable on displays with minimum 360px width)
- Editable top menu
- Optional fully configurable left menu
- Left menu can be pinned (fixed CSS position) or unpinned and collapsed or expanded
- Awesome Font Awesome icons supported in both menus
- Multiple AdminSite’s support with possibility to have different menus, colors and titles for each one
- 9 additional color themes included
- Collapsible fieldsets can be opened by default
- Python3 compatible
Django compatibility¶
On GitHub there is specific branch of Django WP Admin for each major Django version and master branch is always for current stable Django. Releases on PyPI have numbering matching proper Django versions, so for instance for Django 1.7.x you should install Django WP Admin 1.7.y (pip install “django-wpadmin>=1.7,<1.8”). Branches of Django WP Admin for Django older than current stable usually will not have new features added, only bugs will be fixed. Only version for current stable Django will have new features, but any pull requests for older branches are welcome.
Demo¶
Try test_project
here or download django-wpadmin from GitHub and run it on your own machine. test_project
contains SQLite database file with prepopulated sample data.
Installation¶
Install django-wpadmin from PyPI:
pip install django-wpadmin
Or from GitHub:
pip install git+https://github.com/barszczmm/django-wpadmin.git#egg=django-wpadmin
Configuration¶
Add
wpadmin
to yourINSTALLED_APPS
beforedjango.contrib.admin
:INSTALLED_APPS = ( # Django WP Admin must be before django.contrib.admin 'wpadmin', )
Add django.core.context_processors.request to TEMPLATE_CONTEXT_PROCESSORS setting.
Advanced topics¶
Advanced configuration¶
Available options¶
There is only one optional setting for Django WP Admin that can be added to settings.py
file:
WPADMIN = {
'admin': {
'admin_site': 'test_project.admin.admin',
'title': 'Django admin panel',
'menu': {
'top': 'wpadmin.menu.menus.BasicTopMenu',
'left': 'wpadmin.menu.menus.BasicLeftMenu',
},
'dashboard': {
'breadcrumbs': True,
},
'custom_style': STATIC_URL + 'wpadmin/css/themes/sunrise.css',
}
}
As you can see this setting is a dictionary and it contains settings for each admin site you want to configure (usually you will have only one admin site under /admin/
path, so WPADMIN
dict will only have settings under admin
key).
Lets explain it a little:
- admin
- This is a key in dict and it must be equal to the URL path where you have your admin site. So if your admin site is accessible on
http://mydomain.com/mysuperduperadmin/
then all settings for this admin site must be inWPADMIN['mysuperduperadmin']
.
OK so what settings are available:
- admin_site
- Path to admin site instance. So for example if you created
django.contrib.admin.sites.AdminSite
instance inadmin.py
file in your project’s directory (so you have something likeadmin = AdminSite(name='admin')
in that file) then you should putyourproject.admin.admin
here. - title
- Title of admin site. It will be used in
title
meta tag on site. - menu
- Dictionary which contains paths to classes for top and left menu to show on admin site. Read more about those classes in next section.
- dashboard
- Dictionary containing settings not related to menus (so related to everything else on page). Currently there is only one setting available here:
breadcrumbs
- set it to True to see breadcrumbs on page, False to hide breadcrumbs. - custom_style
- Path to custom CSS file to be included on all admin pages. You should use
STATIC_URL
as prefix here. You can create your own custom style or use one of color themes provided with Django WP Admin. Those included themes are inwpadmin/css/themes/
and here is a list of them:blue.css
,coffee.css
,default.css
(this one is used by default so no need to include it),ectoplasm.css
,light.css
,midnight.css
,ocean.css
,sunrise.css
. So if you like coffee then you should probably putSTATIC_URL + 'wpadmin/css/themes/coffee.css'
in this setting ;)
Changes in Django’s ModelAdmin behaviour¶
Ignored ModelAdmin options¶
Some options of Django’s ModelAdmin are ignored when Django WP Admin is used:
- ModelAdmin.actions_on_top
- Actions and pagination are always visible above objects lists.
- ModelAdmin.actions_on_bottom
- Actions and pagination are always visible below objects lists.
- ModelAdmin.save_on_top
- Save buttons are always displayed at the bottom of the page.
Additional ModelAdmin options¶
There is one additional class for fieldsets: collapse-opened
- it tells Django to create collapsible fieldset but opened by default.
Translations¶
If you want to help to translate this software please join me on Transifex: transifex.com/projects/p/django-wp-admin/
Here is a list of available translations.
English¶
Source (default) language.
Bulgarian¶
Thanks to Metodi Dejanov
Dutch (Netherlands)¶
Thanks to rico moorman
Indonesian¶
Thanks to Al Firdaus
Italian¶
Thanks to Giuseppe Pignataro
Polish¶
100% by me (Maciej ‘barszcz’ Marczewski)
Portuguese (Brazil)¶
Thanks to Kaio Henrique
Russian¶
Thanks to Eugene MechanisM
Changelog¶
v1.7.4 (2015-05-08)¶
- small updates in styles
- typo fixed in one translation
- requirements in test project updated
v1.7.3 (2015-04-20)¶
- another fix for small visual regression
v1.7.2 (2015-03-24)¶
- fixed small visual regression
- added Dutch translation (thanks to Rico Moorman)
v1.7.1 (2015-03-23)¶
- change list page template modified to include object-tools and object-tools-items blocks
- styles modified to style added blocks
- small cleanup in some templates
- added new translations: Bulgarian (thanks to Metodi Dejanov), French (thanks to qmarlats), Portuguese (Brazil) (thanks to Kaio Henrique).
- updated docs about translations
- Font Awesome updated to version 4.3.0
- Less updated to version 2.4.0
v1.7.0 (2014-11-24)¶
- merged template changes from Django 1.7
- using new features (site_header and site_title) of AdminSite from Django 1.7
- testing project updated for Django 1.7
- small updates in styles
v1.6.3 (2014-11-20)¶
- fix for tabular inlines
- added sample tabular and stacked inlines in test project
- added new translations: German (thanks to Silasoa), Indonesian (thanks to Al Firdaus), Italian (thanks to Giuseppe Pignataro), Russian (thanks to Eugene MechanisM).
- updated docs about translations
- Font Awesome updated to version 4.2.0
- Less updated to version 2.0.0
- jQuery Cookie plugin updated to version 1.4.1
- added 2 new color themes: milo and milo-light
v1.6.2 (2014-03-21)¶
- fix for top menu hover colors in themes
- added color theme chooser on user panel in test project
v1.6.1 (2014-03-13)¶
- Python3 compatibility
- updated templates for password reset and change (from /registration template path)
- updated template for login page to make it more consistent with rest of the pages
- fixed bug with submenu when left menu is folded
- more fixes for small resolutions screens
- proper login forms in test project used
v1.6.0 (2014-03-11)¶
- backward compatibility breaking release!
- most of things was rewritten
- from now on there will be separate branch for each major Django version and Django WP Admin will be versioned according to Django version it supports...
- ...so this version is compatible only with Django 1.6.x
- all JavaScript libraries updated
- FontAwesome updated to version 4.0.3
- new WordPress admin look
- styles for selector widget
- styles for calendar widget
- styles for timepicker widget
- styles for delete confirmation page
- styles for history page
- collapsible fieldsets can be opened by default
- support for nested submenus
- 7 additional color themes added
- added licenses for all included external files (fonts and JS)
v0.2.0 (2013-04-02)¶
- styled object’s editing pages
v0.1.2 (2013-03-23)¶
- Django 1.3 support dropped! (there’s too much differences between Django 1.3 and 1.4)
- installation process slightly changed (there’s no need to copy or symlink base.html file for specific Django version)
- added WordPress look and feel for objects lists (change_list.html)
- CHANGELOG added
v0.1.1 (2013-03-19)¶
- installation scripts
- README and LICENSE files added
v0.1.0 (2013-03-19)¶
- top and left menu
Troubleshooting¶
Please create an issue on GitHub if you have any problems or requests.
Credits¶
Python code is based on django-admin-tools app.
WordPress look and feel is of course inspired by WordPress.
Included icons comes from Font Awesome.