【发布时间】:2014-08-27 00:40:45
【问题描述】:
我在提供静态文件时遇到问题 - 即我的 html 页面所需的样式表和图像。我似乎无法理解为什么找不到这些静态图像。这是我在settings.py 中的内容
STATIC_URL = PROJECT_PATH + '/static/'
# Additional locations of static files
STATICFILES_DIRS = (PROJECT_PATH + "/static/",)
STATIC_ROOT = "/static/"
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
当我进入日志时,出现 404 错误。但我无法弄清楚 OpenShift 在哪里寻找或调试或弄清楚 OpenShift 在哪里寻找这些图像。我尝试过使用STATIC_URL = '/static/',但这也不起作用。
【问题讨论】: