Opened 16 years ago
Closed 13 years ago
#8995 closed New feature (fixed)
Add support for https to sitemaps
Reported by: | John Hensley | Owned by: | Aymeric Augustin |
---|---|---|---|
Component: | contrib.sitemaps | Version: | dev |
Severity: | Normal | Keywords: | sitemaps |
Cc: | miracle2k, John Hensley, mmitar@…, Marcel Eyer | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I needed to put HTTPS URLs in my sitemaps, and wanted to ping search engines other than Google. The attached patch adds those enhancements.
Attachments (5)
Change History (31)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 15 years ago
Cc: | added |
---|
follow-up: 4 comment:3 by , 15 years ago
It seems yahoo is pinged twice by this patch, once with the sitemap url (super call), and then again with the base url. Any particular reason for this?
comment:4 by , 15 years ago
Replying to miracle2k:
It seems yahoo is pinged twice by this patch, once with the sitemap url (super call), and then again with the base url. Any particular reason for this?
Well, I'd like to think it was because in trying to get Yahoo! to crawl my sites I found it necessary, but it's been so long I don't remember, and now it does seem redundant and spammy. The overridden ping method can probably be removed entirely, so just the sitemap is submitted.
comment:5 by , 15 years ago
Cc: | added |
---|
I updated the patch to work with recent code. For now I just removed Yahoo, as the ping service seems to be broken and is always returning 403 Forbidden. It's not possible that I reached their rate limit, I tried from multiple IPs, and it seems to be reported pretty widely. Some claim you now need to get an app ID and use the update notification service instead. If that's true, Yahoo hasn't updated their docs.
At any rate, I'm afraid that's all the time I have for this at the moment, so Yahoo's out.
comment:6 by , 14 years ago
Cc: | added |
---|
comment:7 by , 14 years ago
Cc: | added |
---|
comment:8 by , 14 years ago
Component: | Contrib apps → contrib.sitemaps |
---|
comment:9 by , 14 years ago
Easy pickings: | unset |
---|---|
Needs tests: | set |
Severity: | → Normal |
Type: | → New feature |
comment:10 by , 13 years ago
Patch needs improvement: | set |
---|---|
UI/UX: | unset |
Those are really two features in one ticket, please decide which you want to cover here and open a new ticket for the other feature. Thanks.
comment:11 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Sorry, don't have time to spend on this one now. After three years, it's clearly not needed; let's just get it off the list.
comment:14 by , 13 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Let's decide this ticket is only about HTTPS URLs in sitemaps (something I've missed in the past...) and forget about Yahoo, which no longer offers a "ping" feature.
comment:15 by , 13 years ago
Summary: | django.contrib.sitemaps enhancements → Add support for https to sitemaps |
---|
Changing the title..
comment:17 by , 13 years ago
Thanks for the patch! This will fix "URLs not followed" warning in Google Webmaster Tools for HTTPS locations in sitemaps.
comment:18 by , 13 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
Triage Stage: | Accepted → Ready for checkin |
comment:19 by , 13 years ago
One question, the current patch changes the index view to use the sitemap's protocol for the site map URL locations rather than just relying on request.is_secure()
. Isn't this slightly backwards incompatible?
comment:20 by , 13 years ago
That's backwards incompatible indeed, but the feature request is valid. The sitemap class should check if a protocol is specified as a class attribute and fallback to the request.is_secure
check. In doubt this could all be a method called get_protocol
or similar to allow the users to customize things.
comment:21 by , 13 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
by , 13 years ago
Attachment: | django-sitemap-protocol.diff added |
---|
Backward-compatible patch with docs
comment:23 by , 13 years ago
Patch needs improvement: | unset |
---|
I've added a patch that includes the docs (thanks, Marco) and falls back to the request protocol if the sitemap doesn't specify it.
comment:24 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:25 by , 13 years ago
There are several major issues with the current patch:
- it isn't acceptable to slap a
request
attribute on theSitemap
object and then magically use it withinSitemap.get_urls
- duplicating all the tests isn't a sustainable approach
- it seems to me that the patch doesn't actually work because the
request
attribute is only added inviews.index
, notviews.sitemap
I'm currently working on a more invasive patch that should eventually result in cleaner code. I'll upload a patch when it is ready.
Sounds like a reasonable enhancement. It'll have to wait until we have a 1.0.x branch. I have not examined this patch.