我想服务,如文件robots.txt
,humans.txt
和manifest.json
。
我看到了文档,但没有找到解决方案,发现view.render
只提供HTML而不提供文本,JSON或任何其他文件。
在以下位置添加文件夹路径和别名 config/storage.py
# config/storage.py
STATICFILES = {
'storage/static': 'static/',
'storage/compiled': 'static/',
'storage/uploads': 'static/',
'storage/root': '/' # add this line
}
在其中创建root
文件夹storage
并将其robots.txt
放入root
文件夹。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句