tuna
tuna

Reputation: 6351

generating sitemap in django

I have a website consist of many models and views already and over 25000 sub-urls. I need to create a sitemap but it is not easy to use django-sitemaps frameworks because we need to add each model.

Is there any easy way to create a sitemap for Django web-sites?

Upvotes: 0

Views: 298

Answers (3)

DJDeveloper
DJDeveloper

Reputation: 111

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.

Upvotes: 0

Jamey Harris
Jamey Harris

Reputation: 19

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.

Upvotes: 1

Hedde van der Heide
Hedde van der Heide

Reputation: 22449

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?

Upvotes: 0

Related Questions