Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move the blog sitemap inside the blog app.

  • Loading branch information...
commit b76acc1cfbe921e5e12d9f3a811741b3a9d9942d 1 parent 6a55052
@aaugustin aaugustin authored
Showing with 17 additions and 13 deletions.
  1. +15 −0 blog/sitemaps.py
  2. +0 −12 django_website/sitemaps.py
  3. +2 −1  django_www/urls.py
View
15 blog/sitemaps.py
@@ -0,0 +1,15 @@
+from __future__ import absolute_import
+
+from django.contrib.sitemaps import Sitemap
+
+from .models import Entry
+
+class WeblogSitemap(Sitemap):
+ changefreq = 'never'
+ priority = 0.4
+
+ def items(self):
+ return Entry.objects.published()
+
+ # lastmod wasn't implemented, because weblog pages used to contain comments.
+
View
12 django_website/sitemaps.py
@@ -3,8 +3,6 @@
from django.contrib.sitemaps import Sitemap
from django.contrib.flatpages.models import FlatPage
-from blog.models import Entry
-
class FlatPageSitemap(Sitemap):
"""
We're not using the built-in django.contrib.sitemaps.FlatPageSitemap,
@@ -28,13 +26,3 @@ def items(self):
# lastmod is not implemented, because we have no way of knowing
# when FlatPages were last updated.
-
-class WeblogSitemap(Sitemap):
- changefreq = 'never'
- priority = 0.4
-
- def items(self):
- return Entry.objects.published()
-
- # lastmod wasn't implemented, because weblog pages used to contain comments.
-
View
3  django_www/urls.py
@@ -11,7 +11,8 @@
from accounts import views as account_views
from aggregator.feeds import CommunityAggregatorFeed, CommunityAggregatorFirehoseFeed
from blog.feeds import WeblogEntryFeed
-from django_website.sitemaps import FlatPageSitemap, WeblogSitemap
+from blog.sitemaps import WeblogSitemap
+from django_website.sitemaps import FlatPageSitemap
admin.autodiscover()
Please sign in to comment.
Something went wrong with that request. Please try again.