Z
Z
zigen2015-11-19 09:48:04
Django
zigen, 2015-11-19 09:48:04

Why Django pulls admin statics from something other than STATIC_ROOT?

Good afternoon.
Decided to customize CSS admin.
The static is collected in STATIC_ROOT, including admin-ki. I also made some changes to the CSS.
But in fact, the admin panel uses statics from the Python34 directory. Customized templates from templates work fine.
Settings:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'

STATIC_ROOT  = os.path.join(BASE_DIR, 'static/')

ROOT_DIR =  os.path.abspath(os.path.dirname(__file__))

STATICFILES_DIRS =  [os.path.join(ROOT_DIR, 'static/'), ]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
un1t, 2015-11-19
@un1t

Because static is also collected from the application layer:

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

S
Sergey, 2015-11-19
@bogdanov-s

Debug=False
also don't forget to run python manage.py collectstatic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question