如何从Masonite提供robots.txt

威巴夫M子

我想服务,如文件robots.txthumans.txtmanifest.json

我看到了文档,但没有找到解决方案,发现view.render只提供HTML而不提供文本,JSON或任何其他文件。

威巴夫M子

在以下位置添加文件夹路径和别名 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文件夹。

访问localhost:8000 / robots.txt

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章