Staff toolbar
The staff toolbar is enabled for every user who is_staff
.
Installation
Add forgepro.stafftoolbar
to your INSTALLED_APPS
,
and the {% stafftoolbar %}
to your base template:
# settings.py
INSTALLED_APPS += [
"forgepro.stafftoolbar",
]
<!-- base.template.html -->
{% load stafftoolbar %}
<!doctype html>
<html lang="en">
<head>
...
</head>
<body>
{% stafftoolbar %}
...
</body>
More specific settings can be found below.
Custom links
Staff links are shown on the right-hand side of the toolbar and can be customzed. By default, it shows a link back to the Django admin:
# settings.py
from forgepro.stafftoolbar import StaffToolbarLink
STAFFTOOLBAR_LINKS = [
StaffToolbarLink(text="Admin", url="admin:index"),
]
Container class
To make the toolbar better match your layout, you can change the classes via settings:
# settings.py
# (showing default values)
STAFFTOOLBAR_CONTAINER_CLASS = "container px-4 mx-auto"