Last Updated: February 25, 2016
·
2.889K
· Gabriel Falcão

Flask handler for ROBOTS.txt

@mod.route("/robots.txt")
def robots_txt():
    Disallow = lambda string: 'Disallow: {0}'.format(string)
    return Response("User-agent: *\n{0}\n".format("\n".join([
        Disallow('/bin/*'),
        Disallow('/thank-you'),
    ])))