← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/maas-static-resources into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/maas-static-resources into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/maas-static-resources/+merge/90399

This branch adds robots.txt and favicon.ico (empty for now).  These two resources are publicly accessible.
-- 
https://code.launchpad.net/~rvb/maas/maas-static-resources/+merge/90399
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/maas-static-resources into lp:maas.
=== modified file 'src/maasserver/middleware.py'
--- src/maasserver/middleware.py	2012-01-25 14:16:04 +0000
+++ src/maasserver/middleware.py	2012-01-27 10:37:35 +0000
@@ -36,6 +36,8 @@
             "|".join(
                 (reverse('login'),
                  reverse('logout'),
+                 reverse('favicon'),
+                 reverse('robots'),
                  reverse('api-doc'))))
         self.api_url = re.compile(settings.API_URL_REGEXP)
         self.static_url = re.compile(settings.STATIC_URL)

=== added directory 'src/maasserver/static/img'
=== added file 'src/maasserver/static/img/favicon.ico'
=== added file 'src/maasserver/templates/maasserver/robots.txt'
--- src/maasserver/templates/maasserver/robots.txt	1970-01-01 00:00:00 +0000
+++ src/maasserver/templates/maasserver/robots.txt	2012-01-27 10:37:35 +0000
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /

=== modified file 'src/maasserver/urls.py'
--- src/maasserver/urls.py	2012-01-24 22:50:32 +0000
+++ src/maasserver/urls.py	2012-01-27 10:37:35 +0000
@@ -16,6 +16,10 @@
     url,
     )
 from django.contrib.auth.views import login
+from django.views.generic.simple import (
+    direct_to_template,
+    redirect_to,
+    )
 from maasserver.api import (
     api_doc,
     NodeHandler,
@@ -35,6 +39,13 @@
 urlpatterns = patterns('maasserver.views',
     url(r'^accounts/login/$', login, name='login'),
     url(r'^accounts/logout/$', logout, name='logout'),
+    url(
+        r'^robots\.txt$', direct_to_template,
+        {'template': 'maasserver/robots.txt', 'mimetype': 'text/plain'},
+        name='robots'),
+    url(
+        r'^favicon\.ico$', redirect_to, {'url': '/static/img/favicon.ico'},
+        name='favicon'),
 )
 
 # Urls for logged-in users.