
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
django-admin-shortcuts
Advanced tools
It's a simple dashboard app that adds shortcuts to your Django admin homepage. The keyword here is SIMPLE!
Because some people noted that it's sometimes hard to find the app you are looking for on the admin homepage.
"So why don't we customize the admin site a bit?"
"Nah, I don't want to go through all the hassle of editing templates or setting up a complex dashboard app ..."
Well, good thing django-admin-shortcuts is here, because it only takes five minutes of your time to go from the old dreadfully boring admin to the marvelous engineering excellence that is this app.
pip install django-admin-shortcuts
add 'admin_shortcuts'
to your INSTALLED_APPS
, just before 'django.contrib.admin'
<-- IMPORTANT
add ADMIN_SHORTCUTS
to your settings
For example:
ADMIN_SHORTCUTS = [
{
'title': 'Authentication',
'shortcuts': [
{
'title': 'Groups',
'url_name': 'admin:auth_group_changelist',
'has_perms': ['example.change_group', 'example.delete_group'],
},
{
'title': 'Add user',
'url_name': 'admin:auth_user_add',
'test_func': 'example.utils.has_perms_to_users',
},
]
},
]
Where ...
url_name
is a name that will be resolved using Django's reverse url method (see Django docs https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#admin-reverse-urls)app_name
is the name of the admin app that will be used for URL reversal. You can safely ignore this if you have only one admin site in your urls.py
url
is a direct link that will override url_name
url_extra
is extra stuff to be attached at the end of the url (like GET data for pre-filtering admin views)title
is the title of the shortcutcount
and count_new
are paths to a function inside your project that returns something interesting (like a count of all products or a count of all pending orders).
The function can optionally take one argument, request
, which is the current Django HttpRequest
object.test_func
is a path to a function inside your project that returns a boolean. If True the shortcut is displayed.
Like above, this function can optionally take one argument request
as well.has_perms
is a list of strings representing the built-in admin permissions required to display the shortcut.open_new_window
sets whether the link should open in a new window (default is False)icon
is an emoji (if you don't specify one, magical ponies will do it for you)profit!!
optionally, also add ADMIN_SHORTCUTS_SETTINGS
to your settings
ADMIN_SHORTCUTS_SETTINGS = {
'open_new_window': False,
}
Where ...
open_new_window
makes all shortcuts open in a new windowADMIN_SHORTCUTS = [
{
'shortcuts': [
{
'url': '/',
'open_new_window': True,
},
{
'url_name': 'admin:logout',
},
{
'title': 'Users',
'url_name': 'admin:auth_user_changelist',
'count': 'example.utils.count_users',
},
{
'title': 'Groups',
'url_name': 'admin:auth_group_changelist',
'count': 'example.utils.count_groups',
'has_perms': ['example.change_group', 'example.delete_group'],
},
{
'title': 'Add user',
'url_name': 'admin:auth_user_add',
'test_func': 'example.utils.has_perms_to_users',
'has_perms': 'example.utils.has_perms_to_users',
},
]
},
{
'title': 'CMS',
'shortcuts': [
{
'title': 'Pages',
'url_name': 'admin:index',
},
{
'title': 'Files',
'url_name': 'admin:index',
'icon': '❤️'
},
{
'title': 'Contact forms',
'url_name': 'admin:index',
'count_new': '3',
},
{
'title': 'Products',
'url_name': 'admin:index',
},
{
'title': 'Orders',
'url_name': 'admin:index',
'count_new': '12',
},
]
},
]
ADMIN_SHORTCUTS_SETTINGS = {
'open_new_window': False,
}
templates/admin_shortcuts/base.css
templateADMIN_SHORTCUTS_ICON_MAPPINGS
FAQs
Add simple and pretty shortcuts to the django admin homepage.
We found that django-admin-shortcuts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.