【发布时间】:2018-10-07 16:56:29
【问题描述】:
我想提供robots.txt、humans.txt 和manifest.json 等文件。
我查看了文档,但没有找到解决方案,我发现 view.render 仅提供 HTML 而非文本或 JSON 或任何其他文件。
【问题讨论】:
标签: python-3.x robots.txt masonite
我想提供robots.txt、humans.txt 和manifest.json 等文件。
我查看了文档,但没有找到解决方案,我发现 view.render 仅提供 HTML 而非文本或 JSON 或任何其他文件。
【问题讨论】:
标签: python-3.x robots.txt masonite
在config/storage.py中添加文件夹路径和别名
# config/storage.py
STATICFILES = {
'storage/static': 'static/',
'storage/compiled': 'static/',
'storage/uploads': 'static/',
'storage/root': '/' # add this line
}
在storage 中创建root 文件夹并将robots.txt 放入root 文件夹中。
【讨论】: