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 ;)