Django findstatic : No matching file found

♀尐吖头ヾ 提交于 2019-12-05 20:15:43

The setting is STATICFILES_DIRS, not STATIC_FILES_DIRS.

You are also missing a comma in the setting. Without the comma it is treated as a string not a tuple.

It should be:

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "static"),
)
Adam Starrh

At last! Referring here, I learned that the static files directory must be located within the directory of an individual app. I had the static directory in the project root. I moved it into an app directory and it is working now.

This whole project will be using these same static files. If someone knows, do I need to have a copy of them in every App's directory, or can all of my project's apps share a static directory? Thanks!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!