MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / sitemap

Function sitemap

main.py:576–586  ·  view source on GitHub ↗
(language)

Source from the content-addressed store, hash-verified

574
575@app.route("/sitemap_<language>.xml")
576def sitemap(language):
577 try:
578 titles = tutorial_data[get_host()][language].keys()
579 except KeyError:
580 return error404()
581
582 # use today as lastmod to make sure the most recent version is always indexed
583 lastmod = datetime.datetime.utcnow().date()
584 response = make_response(render_template("sitemap.xml", titles=titles, lastmod=lastmod, language=language))
585 response.headers['Content-Type'] = 'application/xml'
586 return response
587
588
589@app.route("/robots.txt")

Callers

nothing calls this directly

Calls 3

get_hostFunction · 0.85
error404Function · 0.85
keysMethod · 0.45

Tested by

no test coverage detected