... itemap ): changefreq = "never" priority = 0.5 def items ( self ): return Entry . objects . filter ( is_draft = False ) def lastmod ( self , obj ): return obj . pub_date 備考: changefreq と priority はそれぞれ <changefreq> と <priority> 要素に対応するクラ ... ス属性です。これらは例の lastmod のように関数として呼び出すことができます。 items() is a method that returns a sequence or QuerySet of objects. The objects ... returned will get passed to any callable methods corresponding to a sitemap property ( location , lastmod , changefreq , and priority ). lastmod は datetime を返すべきです。 There is no location method in this example, but you c ... ... #34138 )。 Django 4.1 における、 Sitemap.items() と呼び出し可能オブジェクト lastmod が空だった場合に、サイトマップインデックスビューがクラッシュするバグが修正されました ( #34088 )。 Django 4.1 において、関連 ... ... with the OpClass() expression. django.contrib.sitemaps The default sitemap index template <sitemapindex> now includes the <lastmod> timestamp where available, through the new get_latest_lastmod() method. Custom sitemap index templates should be updated ... ex templates should be updated for the adjusted context variables , expecting a list of objects with location and optional lastmod attributes. CSRF_COOKIE_MASKED transitional setting is deprecated. The name argument of django.utils.functional.cached_pro ... ... r or unique_together model options no longer results in infinite migrations ( #23452 ). Fixed crash in contrib.sitemaps if lastmod returned a date rather than a datetime ( #23403 ). Allowed migrations to work with app_label s that have the same last par ... ... S . In previous versions, it always used the default cache. django.contrib.sitemaps The sitemap framework now makes use of lastmod to set a Last-Modified header in the response. This makes it possible for the ConditionalGetMiddleware to handle condition ... al GET requests for sitemaps which set lastmod . django.contrib.sites The new django.contrib.sites.middleware.CurrentSiteMiddleware allows setting the current site on ea ... ... 公開されている flatpages を見て、サイトマップにエントリを作成します。これらのエントリには、 location 属性のみが含まれます。 lastmod や changefreq , priority は含まれません。 カスタマイズ例 以下は FlatPageSitemap を使用したURLconfの例です: from django.con ... ... et_language_info_list template tag get_languages_for_item() (Sitemap のメソッド) get_latest_by (Options の属性) get_latest_lastmod() (Sitemap のメソッド) get_linear_geometry() (OGRGeometry のメソッド) get_list_display() (ModelAdmin のメソッド) get_list_ ... ) last_login (models.User の属性) last_modified() (django.views.decorators.http モジュール) last_name (models.User の属性) lastmod (Sitemap の属性) LastValue (django.db.models.functions のクラス) lat_lon() (GeoIP2 のメソッド) latest() (django.db.models. ... 2026年10月08日