4

If I define only one, the page displays without any CSS/JS. If I define both, the pages load fine. Why is that? I thought STATICFILES_DIRS is extraneous?

There's an answer here but it doesn't answer why I need both. It simply says what both does, which in my eyes is the same thing. What's the difference?

List of definitions for STATIC/STATIC_ROOT/STATICFILES_DIR

Community
  • 1
  • 1

2 Answers2

2

From what I have scoured on StackOverflow, I think I can sum it up as follows:

STATIC_ROOT is referenced as the static server, be it the default Django static server or the static server made on Heroku/etc. You point to this in urls.py

STATICFILES_DIR is referencing the stuff within static assets so if there are separate folders, one for CSS, one for JS, etc.

Feel free to add!

Alasdair
  • 298,606
  • 55
  • 578
  • 516
1

STATICFILES_DIRS is extraneous. You only need to use it if you are using a static files directory outside of the static files directories inside of your apps. Without seeing more of your code, and the structure of your project I can't even begin to guess why your pages aren't loading, but you definitely do not need to specify a STATICFILES_DIRS.

ryechus
  • 787
  • 7
  • 17