[Answer]-Generating sitemap in django

0👍

You could create a crawler (scrapy) to index your site, but tbh even with a lot of models it shouldn’t be too hard to create a sitemap, have you run into any issues?

1👍

Django sitemaps and wagtail sitemaps https://docs.wagtail.io/en/stable/reference/contrib/sitemaps.html
does that. It processes all of your models. You can customize the sitemap class s well as the template. I use a docker container and customize the template and the code to for specific needs.

When I add a new blog, it automatically generates the entry.

https://www.fraydit.com/blogs/wagtail-sitemap-in-docker/

Here is an example of an implementation and customizing that module.

0👍

If you are looking for a framework or a library in Django which automatically generate sitemap without manually adding entry in the model then you can definitely use jsl-django-sitemap library.

Salient features of this library:

  • No manual entry required for sitemap url
  • include or exclude specific or all Django apps and their URLs in sitemap
  • can exclude specific URLs matching regex. For example you don’t want your APIs to be crawled then you can create a regex to exclude these URLs from sitemap
  • This library is a wrapper o top of django sitemap

Reference links

Credits: I have developed this library.

Leave a comment