代码之家  ›  专栏  ›  技术社区  ›  Vaibhav Mule

如何从Masonite服务robots.txt

  •  1
  • Vaibhav Mule  · 技术社区  · 8 年前

    robots.txt , humans.txt 和 manifest.json

    我看了文件,没找到解决办法,我找到了 view.render 只提供HTML而不是文本或JSON或任何其他文件。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Vaibhav Mule    8 年前

    在中添加文件夹路径和别名 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 在里面 根 文件夹。

    参观 localhost:8000/robots.txt