【发布时间】:2018-02-22 17:12:42
【问题描述】:
我正在尝试在 heroku 上运行 collectstatic。当我收到此错误时:
remote: 'component ({})'.format(final_path, base_path))
remote: django.core.exceptions.SuspiciousFileOperation: The joined path (/tmp/build_4652acfe079723bc273763513a187201/fonts/glyphicons-halflings-regular.eot) is located outside of the base path component (/tmp/build_4652acfe079723bc273763513a187201/staticfiles)
我想也许我错过了一些与 collectstatic 相关的东西,所以我在本地运行它,得到了完全相同的错误。
然后我去寻找。我发现:
/home/malikarumi/Projects/aishah/jamf35/staticfiles/bootstrap/fonts/glyphicons-halflings-regular.eot
和
/home/malikarumi/Projects/aishah/jamf35/static/bootstrap/fonts/glyphicons-halflings-regular.eot
我的设置:
STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static/bootstrap/fonts/'),
那里有一张票,但似乎是关于路径的,我看不出我的路径有什么问题,https://code.djangoproject.com/ticket/27201 另一个处理文件,可能更接近我的问题,因为它与创建的 tmp 文件有关,但我真的不知道: https://code.djangoproject.com/ticket/26644
我应该注意到我也看过Django: The joined path is located outside of the base path component, Django: How to allow a Suspicious File Operation / copy a file 和 Django | joined path is located outside of the base path component {% static img.thumbnail.url %}, Error 400 with whitenoise,但它们似乎更多地是关于 MEDIA ROOT 问题。
我不确定修复是什么,这里。请指教。谢谢。
【问题讨论】:
标签: django twitter-bootstrap collectstatic