# 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`.
[![Downloads](https://pepy.tech/badge/django-admin-menu)](https://pepy.tech/project/django-admin-menu)
![screenshot](screenshots/drop-down.png)
## 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
![screenshot](screenshots/login.png)
![screenshot](screenshots/form.png)
![screenshot](screenshots/drop-down.png)
## 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
![screenshot](screenshots/ui-dark.png)
Add to your settings.py:
```
ADMIN_STYLE = {
'primary-color': '#2B3746',
'secondary-color': '#354151',
'tertiary-color': '#F2F9FC'
}
```
### Django Theme
![screenshot](screenshots/ui-green.png)
Add to your settings.py:
```
ADMIN_STYLE = {
'primary-color': '#164B36',
'secondary-color': '#092117',
'tertiary-color': '#51B48E'
}
```
### Red Theme
![screenshot](screenshots/ui-red.png)
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
没有合适的资源?快使用搜索试试~ 我知道了~
django-admin-menu:具有水平,选项卡式导航栏的Django管理主题
共45个文件
py:27个
png:7个
txt:2个
需积分: 49 6 下载量 175 浏览量
2021-05-16
08:14:42
上传
评论
收藏 498KB ZIP 举报
温馨提示
Django管理菜单主题 Django管理员的替代主题,它具有一个水平导航栏,其中包含模型的下拉菜单。 可以从settings.py完全主题化。 安装 安装软件包: pip install django-admin-menu 然后在django.contrib.admin之前将admin_menu添加到您的INSTALLED_APPS设置中(否则它将无法工作)。 例如: INSTALLED_APPS = [ 'admin_menu', 'django.contrib.admin', ... ] 设定值 您可以在settings.py调整几个选项来影响主题。 要调整徽标,请更改: ADMIN_LOGO = 'logo.png' 徽标用于每个页面的左上角和登录页面。 您可以使用MENU_WEIGHT设置来调整菜单项的MENU_WEIGHT : MEN
资源详情
资源评论
资源推荐
收起资源包目录
django-admin-menu-master.zip (45个子文件)
django-admin-menu-master
MANIFEST.in 113B
admin_menu
templates
admin
base_site.html 2KB
__init__.py 20B
templatetags
custom_admin_css.py 2KB
custom_admin_menu.py 7KB
__init__.py 0B
custom_admin_logo.py 187B
sass
admin-menu.scss 5KB
.github
workflows
pythonpublish.yml 876B
screenshots
drop-down.png 100KB
ui-dark.png 89KB
ui-red.png 87KB
form.png 89KB
login.png 55KB
ui-green.png 88KB
js
admin-menu.js 0B
LICENSE 1KB
requirements.txt 14B
setup.py 1KB
.gitignore 1KB
demo
world
models.py 1KB
apps.py 116B
management
commands
load_world_data.py 972B
__init__.py 0B
__init__.py 0B
__init__.py 0B
migrations
__init__.py 0B
0002_auto_20200627_0950.py 713B
0001_initial.py 3KB
admin.py 587B
sample
models.py 3KB
static
logo.png 4KB
__init__.py 0B
migrations
__init__.py 0B
0002_auto_20200627_0950.py 875B
0001_initial.py 5KB
admin.py 3KB
kitchensink
wsgi.py 400B
__init__.py 0B
settings.py 3KB
urls.py 871B
db.sqlite3 216KB
requirements.txt 21B
manage.py 809B
README.md 4KB
共 45 条
- 1
WiwiChow
- 粉丝: 40
- 资源: 4501
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Spring Boot和MyBatis的社区问答系统.zip
- (源码)基于Spring Boot和WebSocket的人事管理系统.zip
- (源码)基于Spring Boot框架的云网页管理系统.zip
- (源码)基于Maude和深度强化学习的智能体验证系统.zip
- (源码)基于C语言的Papageno字符序列处理系统.zip
- (源码)基于Arduino的水质监测与控制系统.zip
- (源码)基于物联网的智能家居门锁系统.zip
- (源码)基于Python和FastAPI的Squint数据检索系统.zip
- (源码)基于Arduino的图片绘制系统.zip
- (源码)基于C++的ARMA53贪吃蛇游戏系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0