Django Admin CSS Not Loading in App Platfrom

The rest of the site is working fine but the admin page isbroken since it can’t find the CSS. Works perfect in local but breaks after deploy

here is the static file config in

# Static files (CSS, JavaScript, Images)

#Application Level
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, "files")

    BASE_DIR / 'assets'

all my static files is in ‘assets’ folder in root.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 6, 2024


Did you run python collectstatic after you deployed your app?

One thing that you could try here would be to also set the STATICFILES_DIRS env in your settings file:

import os
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent

# Static files
STATIC_URL = '/static/'  # Ensure this has a leading and trailing slash
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

# Collect static files into a single directory
    os.path.join(BASE_DIR, 'assets'),  # Ensure 'assets' folder exists

# Media files (if needed)
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

If none of those help, what you could try is to set the DEBUG = True in your settings file to see if you would get some extra information. And also check your web console to see which folder are the files being loaded from exactly.

Let me know how it goes!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel