“django-STATICFILES_DIRS not collecting” would be: “django的STATICFILES_DIRS未收集到”

huangapple go评论64阅读模式
英文:

django-STATICFILES _DIRS not collecting

问题

In my django project settings, I defined my static files like so:

STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR + '/static/'

STATICFILES_DIRS = [
BASE_DIR + '/folder1',
BASE_DIR + '/folder2',
]

But collectstatic doesn't collect what is defined in "STATICFILES_DIRS".

Even though it works locally, on the server it doesn't work.

What am I doing wrong?

英文:

In my django project settings, I defined my static files like so:

STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR + '/static'

STATICFILES_DIRS = [
    BASE_DIR +'/folder1',
    BASE_DIR + '/folder2',
]

But collectstatic doesn't collect what is defined in "STATICFILES_DIRS".

Even though it works locally, on the server it doesn't work.

What am I doing wrong?

答案1

得分: 0

我检查了我的NGINX配置文件后,解决了问题。现在一切都正常工作。

英文:

I fixed the problem after checking my NGINX config file.
Now everything works good.

huangapple
  • 本文由 发表于 2023年5月25日 04:19:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76327143.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定