2010-08-27 23:16:04 +08:00
|
|
|
from datetime import datetime
|
|
|
|
from django.conf.urls.defaults import *
|
2010-08-30 23:09:12 +08:00
|
|
|
from django.contrib.sitemaps import Sitemap, GenericSitemap
|
|
|
|
from django.contrib.auth.models import User
|
2010-08-27 23:16:04 +08:00
|
|
|
|
|
|
|
class SimpleSitemap(Sitemap):
|
|
|
|
changefreq = "never"
|
|
|
|
priority = 0.5
|
2010-08-30 23:09:12 +08:00
|
|
|
location = '/location/'
|
2010-08-27 23:16:04 +08:00
|
|
|
lastmod = datetime.now()
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
return [object()]
|
|
|
|
|
2010-08-30 23:09:12 +08:00
|
|
|
simple_sitemaps = {
|
2010-08-27 23:16:04 +08:00
|
|
|
'simple': SimpleSitemap,
|
|
|
|
}
|
|
|
|
|
2010-08-30 23:09:12 +08:00
|
|
|
generic_sitemaps = {
|
|
|
|
'generic': GenericSitemap({
|
|
|
|
'queryset': User.objects.all()
|
|
|
|
}),
|
|
|
|
}
|
|
|
|
|
2010-08-27 23:16:04 +08:00
|
|
|
urlpatterns = patterns('django.contrib.sitemaps.views',
|
2010-08-30 23:09:12 +08:00
|
|
|
(r'^simple/sitemap\.xml$', 'sitemap', {'sitemaps': simple_sitemaps}),
|
|
|
|
(r'^generic/sitemap\.xml$', 'sitemap', {'sitemaps': generic_sitemaps}),
|
2010-08-27 23:16:04 +08:00
|
|
|
)
|