kc-ewg
Last Updated: February 25, 2016
·
1.492K
· gabrielfalcao

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'),
    ])))