Multilanguage's Sitemap, get_absolute_url and location

Plz help me with the correct Sitemap generation. My multilanguage site on Django 2.2 with standard internationalization framework. with get_absolute_url

class Data(models.Model):
    def get_absolute_url(self):
        from django.urls import reverse
        return reverse("data_detail", kwargs={"slug": str(})

class DataSitemap (Sitemap):
    changefreq = "daily"
    priority = 0.5
    i18n = True

    def items(self):
        return Data.objects.all()

    def location(self, obj):
        return '/news/data/%s/' % (

from django.contrib.sitemaps.views import sitemap
from .sitemaps import DataSitemap

sitemaps = {
    'data'   : DataSitemap

urlpatterns = i18n_patterns(
   path("sitemap.xml", sitemap, {"sitemaps": sitemaps}, 

Now when I generate sitemap.xml I get no language prefix,


For the other Model without with get_absolute_url but without harcoded location - everything works fine, language prefix added correctly.

How can I fix my Sitemap code?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum