diff --git a/anytask/index/views.py b/anytask/index/views.py index e392c8cd..65a59fba 100644 --- a/anytask/index/views.py +++ b/anytask/index/views.py @@ -1,6 +1,10 @@ from django.shortcuts import render from schools.models import School +ROBOTS_TXT = """User-agent: * +Allow: / +Clean-param: next /accounts/login/ +""" def index(request): schools = School.objects.all().filter(is_active=True).order_by('name') @@ -24,3 +28,7 @@ def archive_index(request): } return render(request, 'archived_schools_page.html', context) + + +def robotstxt_view(request): + return HttpResponse(ROBOTS_TXT, content_type="text/plain") diff --git a/anytask/urls.py b/anytask/urls.py index b3165ee9..af040007 100644 --- a/anytask/urls.py +++ b/anytask/urls.py @@ -46,4 +46,5 @@ url(r'^jupyter/', include('jupyter.urls')), url(r'^set_lang/', set_lang_view, name='set_lang'), url(r'^get_lang/', get_lang_view, name='get_lang'), + url(r'^$', index.views.index, name="index.views.robotstxt_view"), ]