Why do I need to define STATIC_URL and STATICFILES_DIRS?

If I define only one, the page is rendered without CSS / JS. If I define both, the pages load fine. Why is this? I thought STATICFILES_DIRS was an outsider?

There is an answer here, but it doesn’t answer, why should I both. He just says that both are doing the same thing in my eyes. Who cares?

Definition List for STATIC / STATIC_ROOT / STATICFILES_DIR

+4
source share
2 answers

From what I spent on StackOverflow, I can summarize as follows:

STATIC_ROOT is referenced as a static server, whether it is a default static Django server or a static server created on Heroku / etc. You point it out in urls.py

STATICFILES_DIR , , , CSS, JS ..

!

+2

STATICFILES_DIRS . , . , , , STATICFILES_DIRS.

+1

All Articles