DJango admin is serving static files from /media instead of /static

When I run my django app in production mode (ie without DEBUG), my admin site tries to serve static files from "/media" instead of "/static", which causes 404s

This is what it's trying to serve.

GET https://<domain>/media/admin/css/base.css

But if I manually type in


It serves the static file correctly. So my "collectstatic" is working fine, but somehow the admin site is trying to serve from /media.

I don't understand what settings would cause this. Everything I search for related to this is from before django 1.4 where there was a specific setting for admin media url. Other than that I don't see anyone else having this issue.

I'm loosely following and I'm on the latest version of django right now. I'm not sure what else to look for

A selection of settings (presumably irrelevant ones omitted)


    # "django.contrib.humanize", # Handy template tags

# ------------------------------------------------------------------------------
STATIC_ROOT = str(ROOT_DIR / "staticfiles")
STATIC_URL = "/static/"
STATICFILES_DIRS = [str(APPS_DIR / "static")]

# ------------------------------------------------------------------------------
MEDIA_ROOT = str(APPS_DIR / "media")
MEDIA_URL = "/media/"

# ------------------------------------------------------------------------------
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [str(APPS_DIR / "templates")],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [


from .base import *  # noqa
from .base import env
COLLECTFAST_STRATEGY = "collectfast.strategies.filesystem.FileSystemStrategy"

# Collectfast
# ------------------------------------------------------------------------------
INSTALLED_APPS = ["collectfast"] + INSTALLED_APPS  # noqa F405

Note that most of the static file settings are declared in my, which is included when I run this in "debug" mode using config/settings/ And that works fine. It's only in production mode that it's trying to serve the static files out of /media

It turns out this was caused by the provided by the cookiecutter template I was using. The default tried to use s3 as the static file location, and I configured it to use the local filesystem. There was probably something wrong with that configuration. I didn't look into it further. Removing the collectfast package worked

Back to Top