Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
django-admin-menu
Readme
An alternative theme for the Django admin that has a horizontal navigation bar with drop down menus for your models. Fully themeable from settings.py
.
Install the package:
pip install django-admin-menu
Then add admin_menu
to your INSTALLED_APPS
setting, before django.contrib.admin
(or it wont work). For example:
INSTALLED_APPS = [
'admin_menu',
'django.contrib.admin',
...
]
There are a couple of options you can adjust in your settings.py
to influence the theme.
To adjust the logo, change:
ADMIN_LOGO = 'logo.png'
The logo is used in the top left of each page and on the login page.
You can adjust the order of the menu items with the MENU_WEIGHT
setting:
MENU_WEIGHT = {
'World': 20,
'Auth': 4,
'Sample': 5
}
Items with a higher weight will be pushed to the end of the menu. You don't have to fill in all the menu items, just the ones you would like to adjust the position of.
There are a few settings on your ModelAdmin
class to adjust the menu:
class MyAdmin(admin.ModelAdmin):
menu_title = "Users"
menu_group = "Staff"
will change the title for this model to Users
and place it on a drop down titled Staff
.
You can use the same menu_group
on multiple ModelAdmin
classes and they will be grouped on the same menu.
To adjust the theme, you can add and edit these options in your project's settings.py
file:
ADMIN_STYLE = {
'primary-color': '#164B36',
'secondary-color': '#092117',
'tertiary-color': '#51B48E'
}
These variables are usually enough to add a brand flavour to the admin. There are other variables you can add, to change text colour etc. These are listed under Custom Theme.
Add to your settings.py:
ADMIN_STYLE = {
'primary-color': '#2B3746',
'secondary-color': '#354151',
'tertiary-color': '#F2F9FC'
}
Add to your settings.py:
ADMIN_STYLE = {
'primary-color': '#164B36',
'secondary-color': '#092117',
'tertiary-color': '#51B48E'
}
Add to your settings.py:
ADMIN_STYLE = {
'primary-color': '#B42D33',
'secondary-color': '#000000',
'tertiary-color': '#333333'
}
You can customise the theme however you like, using these available variables:
ADMIN_STYLE = {
'background': 'white',
'primary-color': '#205280',
'primary-text': '#d6d5d2',
'secondary-color': '#3B75AD',
'secondary-text': 'white',
'tertiary-color': '#F2F9FC',
'tertiary-text': 'black',
'breadcrumb-color': 'whitesmoke',
'breadcrumb-text': 'black',
'focus-color': '#eaeaea',
'focus-text': '#666',
'primary-button': '#26904A',
'primary-button-text':' white',
'secondary-button': '#999',
'secondary-button-text': 'white',
'link-color': '#333',
'link-color-hover': 'lighten($link-color, 20%)',
'logo-width': 'auto',
'logo-height': '35px'
}
First release, works.
Added theming support.
ADMIN_LOGO
setting optional.logo-width
and logo-height
style settings.verbose_name
from the AppConfig
class wasn't used in the menuMIT
FAQs
A Django admin theme with a horizontal, tabbed navigation bar
We found that django-admin-menu 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.