Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sitemaps.py 584B

1234567891011121314
  1. from django.apps import apps as django_apps
  2. from django.contrib.sitemaps import Sitemap
  3. from django.core.exceptions import ImproperlyConfigured
  4. class FlatPageSitemap(Sitemap):
  5. def items(self):
  6. if not django_apps.is_installed("django.contrib.sites"):
  7. raise ImproperlyConfigured(
  8. "FlatPageSitemap requires django.contrib.sites, which isn't installed."
  9. )
  10. Site = django_apps.get_model("sites.Site")
  11. current_site = Site.objects.get_current()
  12. return current_site.flatpage_set.filter(registration_required=False)