Help: Django 4.2 admin page CSS issue


I upgrade from dgango 4.1 to v4.2 and when i open django admin page it look like below:

i open admin page on different browsers and the problem still. what cause the problem?


This is the login page for the admin?

Are you using a custom login page or customized CSS for the default page?

If either one is true, I’d suggest going back to the defaults until you can figure out what the conflict is.

I don’t use custom css for admin page, also i disable all css links and these are my custom admin setting i use = 'MySite Administration' = 'MySite Site administration' = 'MySite site admin'

i disable them and close browser and open it again on incognito mode and the problem not solved.

I have exactly the same issue when I open Django Admin page in Chrome, however this issue disappears when I open the admin page in Safari.

When using Safari, the Django Admin page looks good:


When using Chrome, the Django Admin page looks as @ZorinArch showed.

Django version: 4.2
Chrome: Version 111.0.5563.146 (Build oficial) (arm64)
Chip Apple M1 Pro

My first suggestion in cases like this is to make sure your local browser cache is cleared. And, in Chrome, you can run with the browser cache disabled if you have the developer tools open.

I too have exactly the same problem after upgrading Django to 4.2. The layout on admin page appears to be broken. I cleared the browser cache but it is still the same. I also rebuilt and redeployed my static assets, but the problem persists.

You’ll want to verify that when the admin page is being loaded that your browser is issuing requests for the various static files. Check the console log where you’re running runserver, you should see those requests. If you don’t, then the browser isn’t making them. (You can also check the browser’s developer tools on the network tab to see the network requests being made by the browser.)

Same here:
console log:
[20/Apr/2023 10:15:53] “GET /admin/ HTTP/1.1” 200 5559
[20/Apr/2023 10:15:53] “GET /static/admin/css/base.css HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/css/dark_mode.css HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/css/dashboard.css HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/css/nav_sidebar.css HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/css/responsive.css HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/js/nav_sidebar.js HTTP/1.1” 404 179
[20/Apr/2023 10:15:53] “GET /static/admin/js/theme.js HTTP/1.1” 404 179
STATIC_URL = ‘./static/’
STATIC_ROOT = ‘./static’

and also I run “py collectstatic” after I setting STATIC_URL and STATIC_ROOT

STATIC_ROOT should be a complete absolute path to the static directory where static files are to be stored, not a relative reference. See Settings | Django documentation | Django

Beyond that, are you running Django at this point using runserver? If so:

  • What’s the DEBUG setting in your file?
  • What’s the STATICFILES_DIRS setting?
  • What does your root file look like?

If you’re not using runserver, how are you running Django?

Looks like I am not alone.

I am running from runserver, python runserver ip_address:8000

Not seeing a STATICFILES_DIRS setting?

My DEBUG is set to false,
Allowed hosts is [‘*’]

URLS.PY is and contains no Includes.

urlpatterns = [
    path('', include('members.urls')),


Django settings for netadmin project.

Generated by 'django-admin startproject' using Django 4.2.

For more information on this file, see

For the full list of settings and their values, see

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production
# See

# SECURITY WARNING: keep the secret key used in production secret!

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False


# Application definition



ROOT_URLCONF = 'netadmin.urls'

        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [

WSGI_APPLICATION = 'netadmin.wsgi.application'

# Database

    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',

# Password validation

        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',

# Internationalization



USE_I18N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)

STATIC_URL = 'static/'

# Default primary key field type

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

In that case, see the docs at How to manage static files (e.g. images, JavaScript, CSS) | Django documentation | Django, particularly the sections that talk about serving static files during development when DEBUG=False.

(Or, change DEBUG to True)

1 Like

Changed debug to
DEBUG = True
And it is working.

Hope this works for everyone else.

1 Like

For anyone else out there looking for a solution, here is how I fixed my problem with admin layout being broken.

  1. Check if you have a folder “admin” inside your “static” folder.
  2. Delete the “admin” folder.
  3. Git commit & push / rebuild & deploy

Problem fixed.

Make sure that you NEVER commit “admin” static assets to version control because Django will then always load “admin” assets from the repo which may be updated, and will cause bizarre problems.

1 Like

Apparently, setting DEBUG to False will cause the error in loading static files for the admin site. So to fix that, go to your file and set DEBUG to True.

1 Like

@mikekwabs - That’s not the most appropriate solution. What you really want to do in this situation is to properly handle static files as referenced in the docs linked above. Changing DEBUG fixes the symptom, but not the problem.

1 Like

Absolutely true. Got it! Thank you.

I also am experiencing this. Does anyone have a solution?

Apparently static paths are set correctly but browser block them when DEBUG = False
how can i fix this problem??

No, the browser is not blocking them. The issue is that the server is returning a 404 error page instead of the desired css/js which means that your static paths are not set up correctly for a production-style environment. See the link above at Help: Django 4.2 admin page CSS issue - #11 by KenWhitesell.

  1. python collectstatic - did not work for me
  2. python collectstatic --clear - did not work for me
  3. Downgrading from 4.2.4 to lower - did not work for me
  4. Hard refresh browser - did not work for me
  5. Clear cache - did not work for me

What worked for me since I have CloudFront to invalidate entire admin CSS folder, you can do it via AWS CLI or AWS Management Console:
Object path: /static/admin/css/*