Y
Y
Your_House2019-10-24 16:37:14
Django
Your_House, 2019-10-24 16:37:14

Difference between: 1)STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') 2) STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ]?

Is there a difference between
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
and

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
]

?
If there is, what is it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2019-10-24
@Your_House

There is.
STATIC_ROOT - where djanga will put files on the collectstatic command and from where your reverse proxy (nginx / Caddy) will distribute statics. During development, this folder must be empty
STATICFILES_DIRS - folders where your static files are stored, from where they will then be copied to STATIC_ROOT during assembly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question