Django 3.1 |管理页面外观问题
问题描述
今天我已将 Django 更新到最新版本 3.1.
Today I have updated Django to latest version 3.1.
但由于某种原因,当我登录到管理页面时,我只能看到一个看起来很奇怪的管理页面.
But for some reason when the logged in to admin page, all I cans see is a weird looking admin page.
admin.py
谁能帮我出什么问题或者我需要修改什么才能回到原来的管理页面.
Can someone help me what went wrong or what are things I need to modify to get back to original admin page.
提前致谢
解决方案
在您项目的根 urls.py
文件中,只需添加以下代码即可禁用新的侧边栏功能.
In your projects' root urls.py
file, simply add the below code to disable the new sidebar feature.
from django.contrib import admin
admin.autodiscover()
admin.site.enable_nav_sidebar = False
参考:
- https://docs.djangoproject.com/en/3.1/releases/3.1/#django-contrib-admin
- https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.AdminSite.enable_nav_sidebar
相关文章