# Django Admin Menu Theme
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`.
[](https://pepy.tech/project/django-admin-menu)

## Installation
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',
...
]
```
## Settings
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.
### ModelAdmin Settings
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.
## Screenshots



## Theming
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.
### Dark Theme

Add to your settings.py:
```
ADMIN_STYLE = {
'primary-color': '#2B3746',
'secondary-color': '#354151',
'tertiary-color': '#F2F9FC'
}
```
### Django Theme

Add to your settings.py:
```
ADMIN_STYLE = {
'primary-color': '#164B36',
'secondary-color': '#092117',
'tertiary-color': '#51B48E'
}
```
### Red Theme

Add to your settings.py:
```
ADMIN_STYLE = {
'primary-color': '#B42D33',
'secondary-color': '#000000',
'tertiary-color': '#333333'
}
```
### Custom Themes
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'
}
```
## History
#### [1.0] - 2016-12-05
First release, works.
#### [1.1] - 2016-12-16
Added theming support.
#### [1.2] - 2020-04-06
* Added support for Django 3.0+.
* Made the `ADMIN_LOGO` setting optional.
* Allowed adjusting admin logo size with `logo-width` and `logo-height` style settings.
#### [1.3] - 2020-06-27
* Reworked the pagination style to look more inline with the table style
* Fixed an issue where the `verbose_name` from the `AppConfig` class wasn't used in the menu
#### [1.4] - 2020-11-16
* Fixed a bug where the Dashboard icon would be highlighted even if another tab was active
* Display the admin title as text if no logo is defined in the settings
#### [1.5] - 2021-02-14
* Fixed compatibility with Django 3+ (thanks to arturgsb)
#### [unreleased]
## License
MIT

WiwiChow
- 粉丝: 42
- 资源: 4501
最新资源
- sqlserver jtds 驱动
- 微电网逆变器控制策略与并网仿真研究:下垂控制仿真模型及其参考资料综述,微电网逆变器控制策略与并网仿真研究:下垂控制仿真模型及其应用探讨,微电网逆变器控制、并网仿真、下垂控制等仿真模型以及一些参考资料
- DeepSeek清华大学全套学习资料1-5
- 【毕业设计】Python的Django-html深度学习的安全帽佩戴检测系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html深度学习的聊天机器人设计源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html搜索的目标站点内容监测系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 蒙特卡洛思想下的充电汽车负荷曲线生成研究报告:探索1万台汽车的充电负荷曲线模拟,基于蒙特卡洛思想的充电汽车充电负荷曲线生成研究报告-涵盖负荷曲线的精细分析与实际应用解析,基于蒙特卡洛思想生成1000
- DeepSeek 保姆级新手教程
- MATLAB下电转气协同与碳捕集垃圾焚烧虚拟电厂优化调度复现程序及仿真结果展示,基于MATLAB和CPLEX的碳捕集与垃圾焚烧虚拟电厂电转气协同优化调度算法研究,MATLAB代码:计及电转气协同的含碳
- 基于直齿行星齿轮传动系统的ode45求解方法及自由度收敛研究,基于直齿行星齿轮传动系统的ODE45求解及其自由度全收敛分析研究,直齿行星齿轮传动系统ode45求解,自由度全部收敛 本人主攻齿轮动力学
- 洪泽湖流域1951-2008年面雨量变化特征与趋势分析及其防洪减灾应用
- 基于TMS320F2812的PMSM有传感器矢量控制双闭环程序系统,TMS320F2812 DSP矢量控制实现PMSM传感器转速与电流双闭环控制程序,矢量控制dsp2812 主控为TMS320F281
- blender插件,mmd-tools-v2.10.3
- 黑龙江省近45年积温变化
- SVPWM过调制控制技术:深入解析与实际应用,基于SVPWM技术的过调制控制方法的研究与应用,SVPWM过调制控制方法 ,SVPWM; 过调制; 控制方法; 数字信号处理,SVPWM过调制控制策略
- 基于PI控制器与滑膜控制器的三相永磁同步电机无速度传感器控制策略及其SVPWM-MRAS-PI SMC算法研究与应用,基于PI控制器与滑膜控制器的三相永磁同步电机无速度传感器控制策略研究:SVPWM
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论0