django-sitemaps

Sitemap in Django 1.10.7

家住魔仙堡 提交于 2019-12-24 10:06:05
问题 I'm having issues getting the Django setup to generate a sitemap for me. I have added the following to my settings file 'django.contrib.sites', 'django.contrib.sitemaps', and im my urls.py file i have the following: from django.conf.urls import include, url from django.contrib import admin from cms.sitemaps import CMSSitemap from django.contrib.sitemaps.views import sitemap from ames import views admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^contact/',

How to create index for django sitemaps for over 50.000 urls

血红的双手。 提交于 2019-12-22 07:06:43
问题 I have the following url configuration url(r'^sitemap\.xml$', index, {'sitemaps': sitemaps}), url(r'^sitemap-(?P<section>.+)\.xml', cache_page(86400)(sitemap), {'sitemaps': sitemaps}), and sitemaps include following sitemap class ArticlesDetailSiteMap(Sitemap): changefreq = "daily" priority = 0.9 def items(self): return Article.objects.filter(is_visible=True, date_published__lte=timezone.now()) but there are more than 50.000 articles. So i get timeout error when i try /sitemap-articles.xml

How to create index for django sitemaps for over 50.000 urls

北城余情 提交于 2019-12-05 08:38:39
I have the following url configuration url(r'^sitemap\.xml$', index, {'sitemaps': sitemaps}), url(r'^sitemap-(?P<section>.+)\.xml', cache_page(86400)(sitemap), {'sitemaps': sitemaps}), and sitemaps include following sitemap class ArticlesDetailSiteMap(Sitemap): changefreq = "daily" priority = 0.9 def items(self): return Article.objects.filter(is_visible=True, date_published__lte=timezone.now()) but there are more than 50.000 articles. So i get timeout error when i try /sitemap-articles.xml because it tries to get all the articles. Any ideas how should i create an index and make the pagination

Django 1.6: name 'sitemaps' is not defined

心不动则不痛 提交于 2019-12-02 01:28:35
问题 I'm trying to implement sitemaps in my django application but i get the following error. I'm using the django sitemap's framework. I don't know what I'm doing wrong. Traceback: File "mysite/urls.py" in <module> 3. from sitemap import * File "mysite/sitemap.py" in <module> 5. class Sitemap(sitemaps.Sitemap): Exception Type: NameError at / Exception Value: name 'sitemaps' is not defined Here is the sitemap.py file from django.contrib.sitemaps import Sitemap from meddy1.models import Doctor