Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 3.1 | Admin page appearance issue

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.

Django Admin screenshot

admin.py

admin.py

Can someone help me what went wrong or what are things I need to modify to get back to original admin page.

Thanks in advance

like image 495
Raghavendra Avatar asked Aug 06 '20 15:08

Raghavendra


People also ask

Why is my Django admin not working?

Problems running django-admin django-admin should be on your system path if you installed Django via pip . If it's not in your path, ensure you have your virtual environment activated and you can try running the equivalent command python -m django .

Can we change Django admin theme?

To do so, you will have to change the project's settings.py . Find the TEMPLATES section and modify accordingly. To override the default template you first need to access the template you want to modify from the django/contrib/admin/templates/admin directory.

How can I remove extra's from Django admin panel?

Take a look at the Model Meta in the django documentation. Within a Model you can add class Meta this allows additional options for your model which handles things like singular and plural naming. Show activity on this post. inside model.py or inside your customized model file add class meta within a Model Class.


1 Answers

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 

Reference:

  1. https://docs.djangoproject.com/en/3.1/releases/3.1/#django-contrib-admin
  2. https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.AdminSite.enable_nav_sidebar
like image 80
The Go Company Avatar answered Oct 14 '22 19:10

The Go Company