diff --git a/programmer/urls.py b/programmer/urls.py index 1bc677a..74592cb 100644 --- a/programmer/urls.py +++ b/programmer/urls.py @@ -24,7 +24,7 @@ urlpatterns = [ path('admin/statistics/', statistics_view, name='statistics'), # Sitemap path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'), - path('robots.txt', robots_txt, name='robots'), + path('robots.txt', views.robots_txt, name='robots'), path('login/', auth_views.LoginView.as_view(template_name='programmer/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), path('register/', views.RegisterView.as_view(), name='register'), diff --git a/programmer/views.py b/programmer/views.py index 704b174..fc7889e 100644 --- a/programmer/views.py +++ b/programmer/views.py @@ -417,6 +417,7 @@ def statistics_view(request: HttpRequest) -> HttpResponse: def robots_txt(request): """Отдает robots.txt.""" return render(request, 'programmer/robots.txt', content_type='text/plain') + return render(request, 'programmer/robots.txt', content_type='text/plain; charset=utf-8') @require_GET def yandex_html(request: HttpRequest) -> HttpResponse: