xaralis / django-static-sitemaps

Tool for generating sitemaps as static files to serve them from webserver instead of your Django application.
154 stars 73 forks source link

Ping deprecated #78

Closed koutoftimer closed 9 months ago

koutoftimer commented 10 months ago

https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping

tasks.GenerateSitemap now throws

HTTP Error 404: Sitemaps ping is deprecated. See https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping.

jeffbowen commented 10 months ago

Until this gets removed you can set STATICSITEMAPS_PING_GOOGLE to False in your settings.py.

Akay7 commented 10 months ago

I made a pr https://github.com/xaralis/django-static-sitemaps/pull/79

Until this gets removed you can set STATICSITEMAPS_PING_GOOGLE to False in your settings.py.

It wont help at latest Django 5 because there's an import https://github.com/xaralis/django-static-sitemaps/blob/dd4dc66da78bd9f394eb8689eff3c406e3c45499/static_sitemaps/generator.py#L14 of ping_google that doesn't exist anymore at Django.

koutoftimer commented 10 months ago

@Akay7 I guess, it is good "first PR": just to wrap that import into if condition and, probably, add some tests.

Akay7 commented 10 months ago

I guess, it is good "first PR": just to wrap that import into if condition

There's no needs to ping google because that endpoint is deprecated on google side. And if there's no endpoint then there's no things to ping even with older version of Django.

and, probably, add some tests.

It's about removing functionality, in this case I should have removed the tests rather than writing them.

mpasternak commented 9 months ago

+1 for @Akay7 fix, is there a maintainer around? @xaralis maybe?

xaralis commented 9 months ago

Released as v5.0.0, thanks @Akay7 . Sorry for the delay, tons of other stuff. https://pypi.org/project/django-static-sitemaps/5.0.0/