Added sitemaps framework and robots framework.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Thu, 22 Jul 2010 19:55:14 +0530
changeset 151 f85b864f5f8b
parent 150 9e0d3287d753
child 152 64d37556e457
Added sitemaps framework and robots framework.
buildout.cfg
initial_fixture.json
project/development.py
project/production.py
project/urls.py
--- a/buildout.cfg	Thu Jul 22 19:54:31 2010 +0530
+++ b/buildout.cfg	Thu Jul 22 19:55:14 2010 +0530
@@ -1,16 +1,23 @@
 [buildout]
-parts = django tagging
+parts = django tagging django-robots
 eggs = 
     Werkzeug
     PIL
+    docutils
 
 [django]
 recipe = djangorecipe
 version = 1.2.1
 settings = production
 eggs = ${buildout:eggs}
-pythonpath = ${tagging:location}
+pythonpath = 
+    ${tagging:location}
+    ${django-robots:location}
 
 [tagging]
 recipe = infrae.subversion
 urls = http://django-tagging.googlecode.com/svn/trunk/ .
+
+[django-robots]
+recipe = mercurialrecipe
+repository = http://bitbucket.org/jezdez/django-robots/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/initial_fixture.json	Thu Jul 22 19:55:14 2010 +0530
@@ -0,0 +1,1 @@
+[{"pk": 1, "model": "sites.site", "fields": {"domain": "example.com", "name": "example.com"}}, {"pk": 2, "model": "sites.site", "fields": {"domain": "localhost:8000", "name": "localhost:8000"}}, {"pk": 3, "model": "sites.site", "fields": {"domain": "scipy.in", "name": "scipy.in"}}]
--- a/project/development.py	Thu Jul 22 19:54:31 2010 +0530
+++ b/project/development.py	Thu Jul 22 19:55:14 2010 +0530
@@ -4,7 +4,7 @@
 DEBUG=True
 TEMPLATE_DEBUG=DEBUG
 
-SITE_ID = 1
+SITE_ID = 2
 
 INSTALLED_APPS = (
     'django.contrib.auth',
@@ -15,6 +15,7 @@
     'django.contrib.sites',
     'django.contrib.flatpages',
     'django.contrib.markup',
+    'django.contrib.sitemaps',
     'project.scipycon',
     'project.scipycon.base',
     'project.scipycon.proceedings',
@@ -22,6 +23,7 @@
     'project.scipycon.user',
     'project.scipycon.talk',
     'tagging',
+    'robots',
 )
 
 DATABASE_ENGINE = 'sqlite3'
--- a/project/production.py	Thu Jul 22 19:54:31 2010 +0530
+++ b/project/production.py	Thu Jul 22 19:55:14 2010 +0530
@@ -3,7 +3,7 @@
 DEBUG=False
 TEMPLATE_DEBUG=DEBUG
 
-SITE_ID = 1 
+SITE_ID = 3
 
 INSTALLED_APPS = (
     'django.contrib.auth',
@@ -14,6 +14,7 @@
     'django.contrib.sites',
     'django.contrib.flatpages',
     'django.contrib.markup',
+    'django.contrib.sitemaps',
     'project.scipycon',
     'project.scipycon.base',
     'project.scipycon.proceedings',
@@ -21,6 +22,7 @@
     'project.scipycon.talk',
     'project.scipycon.user',
     'tagging',
+    'robots',
 )
 
 DATABASE_ENGINE = 'mysql'
--- a/project/urls.py	Thu Jul 22 19:54:31 2010 +0530
+++ b/project/urls.py	Thu Jul 22 19:55:14 2010 +0530
@@ -14,11 +14,15 @@
 SCOPE_ARG_PATTERN = r'(?P<scope>%s/%s)' % (
     PROGRAM_PATTERN_CORE, EVENT_PATTERN_CORE) 
 
+sitemaps = {}
+
 # Admin
 urlpatterns = patterns('',
-    url(r'^$', redirect_to, {'url': '/%s/' % (settings.CURRENT_SCOPE)}),
+    (r'^admin/(.*)', admin.site.root),
     (r'^comments/', include('django.contrib.comments.urls')),
-    (r'^admin/(.*)', admin.site.root),
+    (r'^robots\.txt$', include('robots.urls')),
+    (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
+    url(r'^$', redirect_to, {'url': '/%s/' % (settings.CURRENT_SCOPE)}),
     url(r'^%s/$' % (SCOPE_ARG_PATTERN),
         direct_to_template, {"template": "home.html"}, name='home'),
 )