Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Admin Sidebar Bug

I've been having this weird issue with my Django site for a few weeks now that I can't quite figure out.

Whenever I go to the admin page on my local machine (DEBUG=True) it's completely unusable because the sidebar is filling the entire screen as pictured below:

This began happening when I upgraded to Django 3.1 if that matters (this project started on 2.1)

This does not happen on my live/production site. When I switch DEBUG=False on my local machine it works as expected as well however I can't figure out for the life of me what's causing this. I've tried other browsers as well to no avail.

like image 687
Daniel N. Avatar asked Mar 02 '23 01:03

Daniel N.


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

Thanks to The Go company from this link.

like image 128
Rekoc Avatar answered Mar 05 '23 14:03

Rekoc