[Answered ]-STATIC files are not showed in Django templates

2👍

First, it looks like there is a mistake in your settings. You should understand the django.contrib.staticfiles collectstatic command:

Collects the static files into STATIC_ROOT.
[…]
Files are searched by using the enabled finders. The default is to look in all locations defined in STATICFILES_DIRS and in the ‘static’ directory of apps specified by the INSTALLED_APPS setting.

So, it seems like a mistake that STATICFILES_DIRS contains STATIC_ROOT, since the contents of STATICFILES_DIR is ment to be copied into STATIC_ROOT by collectstatic.

The url is not necessary. You should either:

When in doubt, the findstatic command may also prove useful.

django.contrib.staticfiles might look a little confusing at first, but when you understand it fully you love it <3

👤jpic

Leave a comment