Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Admin Styling corrupted

Tags:

django

I recently made some changes to my django site, one big one being upgrading from Django 2.2 to 3.1. Now my admin site styling is all messed up. I can't figure out what went wrong or how to fix. Any pointers would be appreciated! See image of what it looks like after update.... The main home page for admin looks fine, but when I click on one of the models to view, the formatted is definitely not correct. Also, some not all, of my images on the site are saying 404 not found... enter image description here

enter image description here

like image 523
MattG Avatar asked Aug 04 '20 11:08

MattG


1 Answers

I was facing the same problem, First I thought it was a Cache issue but it wasn't. I checked the page source and found a css file being applied to the page which wasn't even present on my drive.

In my case the file was: static/admin/css/nav_sidebar.css

So I created new file in static/admin/css named nav_sidebar.css, then copy pasted the code which I got from page source and added "display:none;" in the #nav-sidebar section(line:34) and [dir="rtl"] #nav-sidebar section(line:45 in my case).

You can find the Original code here by using Google Chrome's inspect tool. Where to find the code

like image 152
Mihir Avatar answered Sep 19 '22 01:09

Mihir