Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Flask Sitemapper is a Python 3 package that generates XML sitemaps for Flask applications. This allows you to create fully functional sitemaps and sitemap indexes for your Flask projects with minimal code.
You can install the latest version of Flask Sitemapper with pip:
pip install flask-sitemapper
For documentation (including for contributors), see the wiki.
Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site. — sitemaps.org
For more information about sitemaps and the sitemap protocol, visit sitemaps.org
import flask
from flask_sitemapper import Sitemapper
sitemapper = Sitemapper()
app = flask.Flask(__name__)
sitemapper.init_app(app)
@sitemapper.include(lastmod="2022-02-08")
@app.route("/")
def home():
return flask.render_template("home.html")
@sitemapper.include(lastmod="2022-03-19")
@app.route("/about")
def about():
return flask.render_template("about.html")
@app.route("/sitemap.xml")
def sitemap():
return sitemapper.generate()
app.run()
With the above code running on localhost, http://localhost/sitemap.xml
will serve the following XML sitemap:
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://localhost/</loc>
<lastmod>2022-02-08</lastmod>
</url>
<url>
<loc>https://localhost/about</loc>
<lastmod>2022-03-19</lastmod>
</url>
</urlset>
FAQs
Flask extension for generating XML sitemaps
We found that flask-sitemapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.