diff --git a/lms/templates/robots.txt b/lms/templates/robots.txt new file mode 100644 index 000000000000..1f53798bb4fe --- /dev/null +++ b/lms/templates/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/lms/urls.py b/lms/urls.py index f02b1ecadb89..d681eee0ce57 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -9,7 +9,7 @@ from django.contrib.admin import autodiscover as django_autodiscover from django.urls import include, path, re_path from django.utils.translation import gettext_lazy as _ -from django.views.generic.base import RedirectView +from django.views.generic.base import RedirectView, TemplateView from edx_api_doc_tools import make_docs_urls from edx_django_utils.plugins import get_plugin_url_patterns @@ -1030,3 +1030,7 @@ urlpatterns += [ path('api/mfe_config/v1', include(('lms.djangoapps.mfe_config_api.urls', 'lms.djangoapps.mfe_config_api'), namespace='mfe_config_api')) ] + +urlpatterns += [ + path("robots.txt", TemplateView.as_view(template_name="robots.txt", content_type="text/plain")), +]