django-sitemaps

Django sitemap for dynamic static pages

Django sitemap for dynamic static pages Question: I have the following in my views.py: ACCEPTED = ["x", "y", "z", …] def index(request, param): if not (param in ACCEPTED): raise Http404 return render(request, "index.html", {"param": param}) Url is simple enough: path(‘articles/<str:param>/’, views.index, name=’index’), How do I generate a sitemap for this path only for the accepted …

Total answers: 1

django sitemap DoesNotExist at /sitemap.xml

django sitemap DoesNotExist at /sitemap.xml Question: when i add sitemap to my Django project i got this error .. DoesNotExist at /sitemap.xml Site matching query does not exist. sitemap.py : from django.contrib.sitemaps import Sitemap from .models import Homepage class DynamicSitemap(Sitemap): changefreq = “monthly” priority = 0.5 def items(self): return Homepage.objects.all() url.py : from first_app.sitemaps import …

Total answers: 3