From 325660bea1f8863406f8dae00f6de531a0b83386 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 20 Jun 2014 21:54:15 +0200 Subject: [PATCH] Add robots.txt --- gergelypolonkaiweb/templates/robots.txt | 4 ++++ gergelypolonkaiweb/urls.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 gergelypolonkaiweb/templates/robots.txt diff --git a/gergelypolonkaiweb/templates/robots.txt b/gergelypolonkaiweb/templates/robots.txt new file mode 100644 index 0000000..214e411 --- /dev/null +++ b/gergelypolonkaiweb/templates/robots.txt @@ -0,0 +1,4 @@ +# www.robotstxt.org/ +# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 + +User-agent: * diff --git a/gergelypolonkaiweb/urls.py b/gergelypolonkaiweb/urls.py index af13d6e..3dd2fd3 100644 --- a/gergelypolonkaiweb/urls.py +++ b/gergelypolonkaiweb/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import patterns, include, url - +from django.views.generic import TemplateView from django.contrib import admin + admin.autodiscover() handler404 = 'basics.views.notfound' @@ -12,6 +13,7 @@ urlpatterns = patterns('', # Examples: url(r'^$', 'blog.views.mainpage', name='home'), url(r'^google150e54bda5f96d97', 'basics.views.googlevalidator'), + url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type = 'text/plain')), url(r'^blog/', include('blog.urls', namespace='blog')), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),