Last Updated: February 25, 2016
·
2.881K
· 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'),
    ])))