Je l'ai dans mon projet django. En views.py
:comment ajouter cms.urls intégré dans mon application django à sitemap.xml
class MediatorViewSitemap(Sitemap):
changefreq = 'monthly'
priority = 0.8
def items(self):
return Mediator.objects.exclude(photo='')
def lastmod(self, obj):
return obj.modified
static_list =[
'home',
'mediators_list',
'about',
'faq',
'pricing',
'terms',
'privacy',
'contact',
]
class StaticViewSitemap(Sitemap):
priority = 0.5
changefreq = 'daily'
def items(self):
return static_list
def location(self, item):
return reverse(item)
Et dans mon urls.py
sitemaps = {
'mediators': MediatorViewSitemap,
'static': StaticViewSitemap
}
url(
r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
name='django.contrib.sitemaps.views.sitemap'
),
Et générer très bien mon sitemap.xml
Maintenant, je l'ai intégré Django CMS à mon projet django, donc je cette URL dans le même urls.py
:
url(r'^blog/', include('cms.urls')),
Ce que je veux est de l'ajouter à la même sitemap.xml
, une suggestion de tutoriel ou de l'aide de quelqu'un?