Ticket #10909: sitemaps.patch
File sitemaps.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/sitemaps/__init__.py
1 1 from django.core import urlresolvers, paginator 2 from django.conf import settings 2 3 import urllib 3 4 4 5 PING_URL = "http://www.google.com/webmasters/tools/ping" … … 60 61 paginator = property(_get_paginator) 61 62 62 63 def get_urls(self, page=1): 63 from django.contrib.sites.models import Site 64 current_site = Site.objects.get_current() 64 if 'DOMAIN' in settings.get_all_members(): 65 domain = settings.DOMAIN 66 else: 67 from django.contrib.sites.models import Site 68 current_site = Site.objects.get_current() 69 domain = current_site.domain 65 70 urls = [] 66 71 for item in self.paginator.page(page).object_list: 67 loc = "http://%s%s" % ( current_site.domain, self.__get('location', item))72 loc = "http://%s%s" % (domain, self.__get('location', item)) 68 73 url_info = { 69 74 'location': loc, 70 75 'lastmod': self.__get('lastmod', item, None),