Configuration
django-controlcenter
is configured through your project's settings.py
file. All settings are prefixed with CONTROLCENTER_
.
CONTROLCENTER_DASHBOARDS
This is the only required setting. It's a tuple or list that defines all available dashboards.
Each item in the tuple should be a tuple itself, containing a unique URL slug and the Python path to your Dashboard
subclass.
# settings.py
CONTROLCENTER_DASHBOARDS = (
('main', 'my_app.dashboards.MainDashboard'),
('sales', 'my_app.dashboards.SalesDashboard'),
)
With this configuration, the dashboards will be available at:
/admin/dashboard/main/
/admin/dashboard/sales/
For backward compatibility, you can also provide just the path, and a numeric index will be used as the slug.
# settings.py
CONTROLCENTER_DASHBOARDS = (
'my_app.dashboards.MainDashboard', # Accessible at /admin/dashboard/0/
'my_app.dashboards.SalesDashboard', # Accessible at /admin/dashboard/1/
)
CONTROLCENTER_CHARTIST_COLORS
This setting controls the color theme for the charts.
- Type:
str
- Default:
'default'
- Available Values:
'default'
: The default Chartist.js color scheme.'material'
: A color scheme based on Google's Material Design colors.
# settings.py
CONTROLCENTER_CHARTIST_COLORS = 'material'
This generates a different CSS file for chart colors, which can be found in controlcenter/static/controlcenter/css/
.
CONTROLCENTER_SHARP
This setting defines the string used for the header of the row number column in an ItemList
widget.
- Type:
str
- Default:
'#'
To enable the row number column, you must include app_settings.SHARP
in your widget's list_display
.
# settings.py
CONTROLCENTER_SHARP = 'No.'
# your_app/dashboards.py
from controlcenter import widgets, app_settings
class MyList(widgets.ItemList):
list_display = (app_settings.SHARP, 'name', 'email')
# ...
This will result in a column with the header "No.".