Home > Back-end >  Django admin appears broken
Django admin appears broken

Time:09-09

This screenshot show the problem i am having. However, when you minimize window, the page is displayed normally.[enter image description here This is my code in admin.py:

 from django.contrib import admin
from .models import Actualité

# Register your models here.
class ActualitéAdmin(admin.ModelAdmin):
    list_display= ('id','titre','contenu','date_de_publication')

admin.site.register(Actualité, ActualitéAdmin)

when I launch django and I enter the Actualité page mentioned in admin.py it shows me this interface on the page : django admin page appears broken

This is a code in console :

 [08/Sep/2022 11:16:25] "GET /favicon.ico HTTP/1.1" 404 3701
[08/Sep/2022 11:16:36] "POST /admin/login/?next=/admin/ HTTP/1.1" 302 0
[08/Sep/2022 11:16:36] "GET /admin/ HTTP/1.1" 200 11383
[08/Sep/2022 11:16:36] "GET /static/admin/css/dashboard.css HTTP/1.1" 200 439
[08/Sep/2022 11:16:36] "GET /static/css/admin.css HTTP/1.1" 404 1798
[08/Sep/2022 11:16:37] "GET /static/admin/img/icon-addlink.svg HTTP/1.1" 200 334
[08/Sep/2022 11:16:37] "GET /static/admin/img/icon-changelink.svg HTTP/1.1" 200 383
[08/Sep/2022 11:16:37] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
[08/Sep/2022 11:16:39] "GET /admin/Actualité/actualité/ HTTP/1.1" 200 11697
[08/Sep/2022 11:16:39] "GET /admin/jsi18n/ HTTP/1.1" 200 7953
[08/Sep/2022 11:16:39] "GET /static/css/admin.css HTTP/1.1" 404 1798
[08/Sep/2022 11:16:39] "GET /static/admin/js/jquery.init.js HTTP/1.1" 200 371

CodePudding user response:

This is a problem with your static file rendering. You should type the following in the terminal:

python manage.py collectstatic

If this doesn't solve your problem try deleting the static files first and then collectstatic again.

CodePudding user response:

I mean you might want to specify which is the unwanted behavior, is it the secondary scrollbar? Most likely you have some max height set there which forces to display the second scrollbar. Just a little note from UI perspective you might also do a main container or some sort of max width and centralize it as well

  • Related