The following commit has been merged in the master branch:
commit 4a89d4aba004a0df1532ddaae8509015e7b19831
Author: Michal Čihař <[email protected]>
Date: Fri Oct 9 13:49:52 2009 +0200
Initial Google sitemap support.
diff --git a/settings.py b/settings.py
index c8bbae5..958fe3a 100644
--- a/settings.py
+++ b/settings.py
@@ -70,6 +70,7 @@ SECRET_KEY =
'c=kt_6vtz&(418w-0(uti(q5&e76q#lc=%vuwzm&+ulqrkgyp3'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
@@ -105,6 +106,7 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
+ 'django.contrib.sitemaps',
'wammu_web.news',
'wammu_web.wammu',
'wammu_web.downloads',
diff --git a/urls.py b/urls.py
index b1b1e2a..61f3f53 100644
--- a/urls.py
+++ b/urls.py
@@ -1,6 +1,7 @@
from django.conf.urls.defaults import *
-from news.feeds import RssNewsFeed, AtomNewsFeed
+from news.feeds import RssNewsFeed, AtomNewsFeed, Entry
from phonedb.feeds import RssPhonesFeed, AtomPhonesFeed
+from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
newsfeeds = {
'rss': RssNewsFeed,
@@ -12,6 +13,15 @@ phonesfeeds = {
'atom': AtomPhonesFeed,
}
+news_dict = {
+ 'queryset': Entry.objects.all(),
+ 'date_field': 'pub_date',
+}
+
+sitemaps = {
+ 'news': GenericSitemap(news_dict, priority=0.6),
+}
+
from django.contrib import admin
admin.autodiscover()
@@ -110,4 +120,7 @@ urlpatterns = patterns('',
# Compatibility
(r'^install/$', 'django.views.generic.simple.redirect_to', {'url':
'/download/'}),
(r'^improve/$', 'django.views.generic.simple.redirect_to', {'url':
'/contribute/'}),
+
+ # Sitempa
+ (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps':
sitemaps}),
)
--
UNNAMED PROJECT
_______________________________________________
Wammu-svn mailing list
[email protected]
https://lists.cihar.com/cgi-bin/mailman/listinfo/wammu-svn