We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix the count of total projects shown on the homepage
On the hompage (https://readthedocs.org/), we show the total count of the projects.

![Screenshot from 2019-07-15 14-23-42](https://user-images.githubusercontent.com/29149191/61207904-d6b64f00-a713-11e9-9388-8d7222a2a4d7.png)

This number also includes projects that are identified as spam.
It would be good if we exclude spam projects from it.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `readthedocs/core/views/__init__.py`
Content:
```
1 """
2 Core views.
3 
4 Including the main homepage, documentation and header rendering,
5 and server errors.
6 """
7 
8 import os
9 import logging
10 from urllib.parse import urlparse
11 
12 from django.conf import settings
13 from django.http import HttpResponseRedirect, Http404, JsonResponse
14 from django.shortcuts import render, get_object_or_404, redirect
15 from django.views.generic import TemplateView
16 from django.views.static import serve as static_serve
17 
18 from readthedocs.builds.models import Version
19 from readthedocs.core.utils.general import wipe_version_via_slugs
20 from readthedocs.core.resolver import resolve_path
21 from readthedocs.core.symlink import PrivateSymlink, PublicSymlink
22 from readthedocs.projects.constants import PRIVATE
23 from readthedocs.projects.models import HTMLFile, Project
24 from readthedocs.redirects.utils import (
25     get_redirect_response,
26     project_and_path_from_request,
27     language_and_version_from_path
28 )
29 
30 log = logging.getLogger(__name__)
31 
32 
33 class NoProjectException(Exception):
34     pass
35 
36 
37 class HomepageView(TemplateView):
38 
39     template_name = 'homepage.html'
40 
41     def get_context_data(self, **kwargs):
42         """Add latest builds and featured projects."""
43         context = super().get_context_data(**kwargs)
44         context['featured_list'] = Project.objects.filter(featured=True)
45         context['projects_count'] = Project.objects.count()
46         return context
47 
48 
49 class SupportView(TemplateView):
50     template_name = 'support.html'
51 
52     def get_context_data(self, **kwargs):
53         context = super().get_context_data(**kwargs)
54         support_email = settings.SUPPORT_EMAIL
55         if not support_email:
56             support_email = 'support@{domain}'.format(
57                 domain=settings.PRODUCTION_DOMAIN
58             )
59 
60         context['support_email'] = support_email
61         return context
62 
63 
64 def random_page(request, project_slug=None):  # pylint: disable=unused-argument
65     html_file = HTMLFile.objects.internal().order_by('?')
66     if project_slug:
67         html_file = html_file.filter(project__slug=project_slug)
68     html_file = html_file.first()
69     if html_file is None:
70         raise Http404
71     url = html_file.get_absolute_url()
72     return HttpResponseRedirect(url)
73 
74 
75 def wipe_version(request, project_slug, version_slug):
76     version = get_object_or_404(
77         Version.internal.all(),
78         project__slug=project_slug,
79         slug=version_slug,
80     )
81     # We need to check by ``for_admin_user`` here to allow members of the
82     # ``Admin`` team (which doesn't own the project) under the corporate site.
83     if version.project not in Project.objects.for_admin_user(user=request.user):
84         raise Http404('You must own this project to wipe it.')
85 
86     if request.method == 'POST':
87         wipe_version_via_slugs(
88             version_slug=version_slug,
89             project_slug=project_slug,
90         )
91         return redirect('project_version_list', project_slug)
92     return render(
93         request,
94         'wipe_version.html',
95         {'version': version, 'project': version.project},
96     )
97 
98 
99 def server_error_500(request, template_name='500.html'):
100     """A simple 500 handler so we get media."""
101     r = render(request, template_name)
102     r.status_code = 500
103     return r
104 
105 
106 def server_error_404(request, exception=None, template_name='404.html'):  # pylint: disable=unused-argument  # noqa
107     """
108     A simple 404 handler so we get media.
109 
110     .. note::
111 
112         Marking exception as optional to make /404/ testing page to work.
113     """
114     response = get_redirect_response(request, full_path=request.get_full_path())
115 
116     # Return a redirect response if there is one
117     if response:
118         if response.url == request.build_absolute_uri():
119             # check that we do have a response and avoid infinite redirect
120             log.warning(
121                 'Infinite Redirect: FROM URL is the same than TO URL. url=%s',
122                 response.url,
123             )
124         else:
125             return response
126 
127     # Try to serve custom 404 pages if it's a subdomain/cname
128     if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):
129         return server_error_404_subdomain(request, template_name)
130 
131     # Return the default 404 page generated by Read the Docs
132     r = render(request, template_name)
133     r.status_code = 404
134     return r
135 
136 
137 def server_error_404_subdomain(request, template_name='404.html'):
138     """
139     Handler for 404 pages on subdomains.
140 
141     Check if the project associated has a custom ``404.html`` and serve this
142     page. First search for a 404 page in the current version, then continues
143     with the default version and finally, if none of them are found, the Read
144     the Docs default page (Maze Found) is rendered by Django and served.
145     """
146 
147     def resolve_404_path(project, version_slug=None, language=None, filename='404.html'):
148         """
149         Helper to resolve the path of ``404.html`` for project.
150 
151         The resolution is based on ``project`` object, version slug and
152         language.
153 
154         :returns: tuple containing the (basepath, filename)
155         :rtype: tuple
156         """
157         filename = resolve_path(
158             project,
159             version_slug=version_slug,
160             language=language,
161             filename=filename,
162             subdomain=True,  # subdomain will make it a "full" path without a URL prefix
163         )
164 
165         # This breaks path joining, by ignoring the root when given an "absolute" path
166         if filename[0] == '/':
167             filename = filename[1:]
168 
169         version = None
170         if version_slug:
171             version_qs = project.versions.filter(slug=version_slug)
172             if version_qs.exists():
173                 version = version_qs.first()
174 
175         private = any([
176             version and version.privacy_level == PRIVATE,
177             not version and project.privacy_level == PRIVATE,
178         ])
179         if private:
180             symlink = PrivateSymlink(project)
181         else:
182             symlink = PublicSymlink(project)
183         basepath = symlink.project_root
184         fullpath = os.path.join(basepath, filename)
185         return (basepath, filename, fullpath)
186 
187     project, full_path = project_and_path_from_request(request, request.get_full_path())
188 
189     if project:
190         language = None
191         version_slug = None
192         schema, netloc, path, params, query, fragments = urlparse(full_path)
193         if not project.single_version:
194             language, version_slug, path = language_and_version_from_path(path)
195 
196         # Firstly, attempt to serve the 404 of the current version (version_slug)
197         # Secondly, try to serve the 404 page for the default version
198         # (project.get_default_version())
199         for slug in (version_slug, project.get_default_version()):
200             for tryfile in ('404.html', '404/index.html'):
201                 basepath, filename, fullpath = resolve_404_path(project, slug, language, tryfile)
202                 if os.path.exists(fullpath):
203                     log.debug(
204                         'serving 404.html page current version: [project: %s] [version: %s]',
205                         project.slug,
206                         slug,
207                     )
208                     r = static_serve(request, filename, basepath)
209                     r.status_code = 404
210                     return r
211 
212     # Finally, return the default 404 page generated by Read the Docs
213     r = render(request, template_name)
214     r.status_code = 404
215     return r
216 
217 
218 def do_not_track(request):
219     dnt_header = request.META.get('HTTP_DNT')
220 
221     # https://w3c.github.io/dnt/drafts/tracking-dnt.html#status-representation
222     return JsonResponse(  # pylint: disable=redundant-content-type-for-json-response
223         {
224             'policy': 'https://docs.readthedocs.io/en/latest/privacy-policy.html',
225             'same-party': [
226                 'readthedocs.org',
227                 'readthedocs.com',
228                 'readthedocs.io',           # .org Documentation Sites
229                 'readthedocs-hosted.com',   # .com Documentation Sites
230             ],
231             'tracking': 'N' if dnt_header == '1' else 'T',
232         }, content_type='application/tracking-status+json',
233     )
234
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/readthedocs/core/views/__init__.py b/readthedocs/core/views/__init__.py
--- a/readthedocs/core/views/__init__.py
+++ b/readthedocs/core/views/__init__.py
@@ -42,7 +42,7 @@
         """Add latest builds and featured projects."""
         context = super().get_context_data(**kwargs)
         context['featured_list'] = Project.objects.filter(featured=True)
-        context['projects_count'] = Project.objects.count()
+        context['projects_count'] = Project.objects.exclude(users__profile__banned=True).count()
         return context

{"golden_diff": "diff --git a/readthedocs/core/views/__init__.py b/readthedocs/core/views/__init__.py\n--- a/readthedocs/core/views/__init__.py\n+++ b/readthedocs/core/views/__init__.py\n@@ -42,7 +42,7 @@\n         \"\"\"Add latest builds and featured projects.\"\"\"\n         context = super().get_context_data(**kwargs)\n         context['featured_list'] = Project.objects.filter(featured=True)\n-        context['projects_count'] = Project.objects.count()\n+        context['projects_count'] = Project.objects.exclude(users__profile__banned=True).count()\n         return context\n", "issue": "Fix the count of total projects shown on the homepage\nOn the hompage (https://readthedocs.org/), we show the total count of the projects.\r\n\r\n![Screenshot from 2019-07-15 14-23-42](https://user-images.githubusercontent.com/29149191/61207904-d6b64f00-a713-11e9-9388-8d7222a2a4d7.png)\r\n\r\nThis number also includes projects that are identified as spam.\r\nIt would be good if we exclude spam projects from it.\n", "before_files": [{"content": "\"\"\"\nCore views.\n\nIncluding the main homepage, documentation and header rendering,\nand server errors.\n\"\"\"\n\nimport os\nimport logging\nfrom urllib.parse import urlparse\n\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect, Http404, JsonResponse\nfrom django.shortcuts import render, get_object_or_404, redirect\nfrom django.views.generic import TemplateView\nfrom django.views.static import serve as static_serve\n\nfrom readthedocs.builds.models import Version\nfrom readthedocs.core.utils.general import wipe_version_via_slugs\nfrom readthedocs.core.resolver import resolve_path\nfrom readthedocs.core.symlink import PrivateSymlink, PublicSymlink\nfrom readthedocs.projects.constants import PRIVATE\nfrom readthedocs.projects.models import HTMLFile, Project\nfrom readthedocs.redirects.utils import (\n    get_redirect_response,\n    project_and_path_from_request,\n    language_and_version_from_path\n)\n\nlog = logging.getLogger(__name__)\n\n\nclass NoProjectException(Exception):\n    pass\n\n\nclass HomepageView(TemplateView):\n\n    template_name = 'homepage.html'\n\n    def get_context_data(self, **kwargs):\n        \"\"\"Add latest builds and featured projects.\"\"\"\n        context = super().get_context_data(**kwargs)\n        context['featured_list'] = Project.objects.filter(featured=True)\n        context['projects_count'] = Project.objects.count()\n        return context\n\n\nclass SupportView(TemplateView):\n    template_name = 'support.html'\n\n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n        support_email = settings.SUPPORT_EMAIL\n        if not support_email:\n            support_email = 'support@{domain}'.format(\n                domain=settings.PRODUCTION_DOMAIN\n            )\n\n        context['support_email'] = support_email\n        return context\n\n\ndef random_page(request, project_slug=None):  # pylint: disable=unused-argument\n    html_file = HTMLFile.objects.internal().order_by('?')\n    if project_slug:\n        html_file = html_file.filter(project__slug=project_slug)\n    html_file = html_file.first()\n    if html_file is None:\n        raise Http404\n    url = html_file.get_absolute_url()\n    return HttpResponseRedirect(url)\n\n\ndef wipe_version(request, project_slug, version_slug):\n    version = get_object_or_404(\n        Version.internal.all(),\n        project__slug=project_slug,\n        slug=version_slug,\n    )\n    # We need to check by ``for_admin_user`` here to allow members of the\n    # ``Admin`` team (which doesn't own the project) under the corporate site.\n    if version.project not in Project.objects.for_admin_user(user=request.user):\n        raise Http404('You must own this project to wipe it.')\n\n    if request.method == 'POST':\n        wipe_version_via_slugs(\n            version_slug=version_slug,\n            project_slug=project_slug,\n        )\n        return redirect('project_version_list', project_slug)\n    return render(\n        request,\n        'wipe_version.html',\n        {'version': version, 'project': version.project},\n    )\n\n\ndef server_error_500(request, template_name='500.html'):\n    \"\"\"A simple 500 handler so we get media.\"\"\"\n    r = render(request, template_name)\n    r.status_code = 500\n    return r\n\n\ndef server_error_404(request, exception=None, template_name='404.html'):  # pylint: disable=unused-argument  # noqa\n    \"\"\"\n    A simple 404 handler so we get media.\n\n    .. note::\n\n        Marking exception as optional to make /404/ testing page to work.\n    \"\"\"\n    response = get_redirect_response(request, full_path=request.get_full_path())\n\n    # Return a redirect response if there is one\n    if response:\n        if response.url == request.build_absolute_uri():\n            # check that we do have a response and avoid infinite redirect\n            log.warning(\n                'Infinite Redirect: FROM URL is the same than TO URL. url=%s',\n                response.url,\n            )\n        else:\n            return response\n\n    # Try to serve custom 404 pages if it's a subdomain/cname\n    if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):\n        return server_error_404_subdomain(request, template_name)\n\n    # Return the default 404 page generated by Read the Docs\n    r = render(request, template_name)\n    r.status_code = 404\n    return r\n\n\ndef server_error_404_subdomain(request, template_name='404.html'):\n    \"\"\"\n    Handler for 404 pages on subdomains.\n\n    Check if the project associated has a custom ``404.html`` and serve this\n    page. First search for a 404 page in the current version, then continues\n    with the default version and finally, if none of them are found, the Read\n    the Docs default page (Maze Found) is rendered by Django and served.\n    \"\"\"\n\n    def resolve_404_path(project, version_slug=None, language=None, filename='404.html'):\n        \"\"\"\n        Helper to resolve the path of ``404.html`` for project.\n\n        The resolution is based on ``project`` object, version slug and\n        language.\n\n        :returns: tuple containing the (basepath, filename)\n        :rtype: tuple\n        \"\"\"\n        filename = resolve_path(\n            project,\n            version_slug=version_slug,\n            language=language,\n            filename=filename,\n            subdomain=True,  # subdomain will make it a \"full\" path without a URL prefix\n        )\n\n        # This breaks path joining, by ignoring the root when given an \"absolute\" path\n        if filename[0] == '/':\n            filename = filename[1:]\n\n        version = None\n        if version_slug:\n            version_qs = project.versions.filter(slug=version_slug)\n            if version_qs.exists():\n                version = version_qs.first()\n\n        private = any([\n            version and version.privacy_level == PRIVATE,\n            not version and project.privacy_level == PRIVATE,\n        ])\n        if private:\n            symlink = PrivateSymlink(project)\n        else:\n            symlink = PublicSymlink(project)\n        basepath = symlink.project_root\n        fullpath = os.path.join(basepath, filename)\n        return (basepath, filename, fullpath)\n\n    project, full_path = project_and_path_from_request(request, request.get_full_path())\n\n    if project:\n        language = None\n        version_slug = None\n        schema, netloc, path, params, query, fragments = urlparse(full_path)\n        if not project.single_version:\n            language, version_slug, path = language_and_version_from_path(path)\n\n        # Firstly, attempt to serve the 404 of the current version (version_slug)\n        # Secondly, try to serve the 404 page for the default version\n        # (project.get_default_version())\n        for slug in (version_slug, project.get_default_version()):\n            for tryfile in ('404.html', '404/index.html'):\n                basepath, filename, fullpath = resolve_404_path(project, slug, language, tryfile)\n                if os.path.exists(fullpath):\n                    log.debug(\n                        'serving 404.html page current version: [project: %s] [version: %s]',\n                        project.slug,\n                        slug,\n                    )\n                    r = static_serve(request, filename, basepath)\n                    r.status_code = 404\n                    return r\n\n    # Finally, return the default 404 page generated by Read the Docs\n    r = render(request, template_name)\n    r.status_code = 404\n    return r\n\n\ndef do_not_track(request):\n    dnt_header = request.META.get('HTTP_DNT')\n\n    # https://w3c.github.io/dnt/drafts/tracking-dnt.html#status-representation\n    return JsonResponse(  # pylint: disable=redundant-content-type-for-json-response\n        {\n            'policy': 'https://docs.readthedocs.io/en/latest/privacy-policy.html',\n            'same-party': [\n                'readthedocs.org',\n                'readthedocs.com',\n                'readthedocs.io',           # .org Documentation Sites\n                'readthedocs-hosted.com',   # .com Documentation Sites\n            ],\n            'tracking': 'N' if dnt_header == '1' else 'T',\n        }, content_type='application/tracking-status+json',\n    )\n", "path": "readthedocs/core/views/__init__.py"}], "after_files": [{"content": "\"\"\"\nCore views.\n\nIncluding the main homepage, documentation and header rendering,\nand server errors.\n\"\"\"\n\nimport os\nimport logging\nfrom urllib.parse import urlparse\n\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect, Http404, JsonResponse\nfrom django.shortcuts import render, get_object_or_404, redirect\nfrom django.views.generic import TemplateView\nfrom django.views.static import serve as static_serve\n\nfrom readthedocs.builds.models import Version\nfrom readthedocs.core.utils.general import wipe_version_via_slugs\nfrom readthedocs.core.resolver import resolve_path\nfrom readthedocs.core.symlink import PrivateSymlink, PublicSymlink\nfrom readthedocs.projects.constants import PRIVATE\nfrom readthedocs.projects.models import HTMLFile, Project\nfrom readthedocs.redirects.utils import (\n    get_redirect_response,\n    project_and_path_from_request,\n    language_and_version_from_path\n)\n\nlog = logging.getLogger(__name__)\n\n\nclass NoProjectException(Exception):\n    pass\n\n\nclass HomepageView(TemplateView):\n\n    template_name = 'homepage.html'\n\n    def get_context_data(self, **kwargs):\n        \"\"\"Add latest builds and featured projects.\"\"\"\n        context = super().get_context_data(**kwargs)\n        context['featured_list'] = Project.objects.filter(featured=True)\n        context['projects_count'] = Project.objects.exclude(users__profile__banned=True).count()\n        return context\n\n\nclass SupportView(TemplateView):\n    template_name = 'support.html'\n\n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n        support_email = settings.SUPPORT_EMAIL\n        if not support_email:\n            support_email = 'support@{domain}'.format(\n                domain=settings.PRODUCTION_DOMAIN\n            )\n\n        context['support_email'] = support_email\n        return context\n\n\ndef random_page(request, project_slug=None):  # pylint: disable=unused-argument\n    html_file = HTMLFile.objects.internal().order_by('?')\n    if project_slug:\n        html_file = html_file.filter(project__slug=project_slug)\n    html_file = html_file.first()\n    if html_file is None:\n        raise Http404\n    url = html_file.get_absolute_url()\n    return HttpResponseRedirect(url)\n\n\ndef wipe_version(request, project_slug, version_slug):\n    version = get_object_or_404(\n        Version.internal.all(),\n        project__slug=project_slug,\n        slug=version_slug,\n    )\n    # We need to check by ``for_admin_user`` here to allow members of the\n    # ``Admin`` team (which doesn't own the project) under the corporate site.\n    if version.project not in Project.objects.for_admin_user(user=request.user):\n        raise Http404('You must own this project to wipe it.')\n\n    if request.method == 'POST':\n        wipe_version_via_slugs(\n            version_slug=version_slug,\n            project_slug=project_slug,\n        )\n        return redirect('project_version_list', project_slug)\n    return render(\n        request,\n        'wipe_version.html',\n        {'version': version, 'project': version.project},\n    )\n\n\ndef server_error_500(request, template_name='500.html'):\n    \"\"\"A simple 500 handler so we get media.\"\"\"\n    r = render(request, template_name)\n    r.status_code = 500\n    return r\n\n\ndef server_error_404(request, exception=None, template_name='404.html'):  # pylint: disable=unused-argument  # noqa\n    \"\"\"\n    A simple 404 handler so we get media.\n\n    .. note::\n\n        Marking exception as optional to make /404/ testing page to work.\n    \"\"\"\n    response = get_redirect_response(request, full_path=request.get_full_path())\n\n    # Return a redirect response if there is one\n    if response:\n        if response.url == request.build_absolute_uri():\n            # check that we do have a response and avoid infinite redirect\n            log.warning(\n                'Infinite Redirect: FROM URL is the same than TO URL. url=%s',\n                response.url,\n            )\n        else:\n            return response\n\n    # Try to serve custom 404 pages if it's a subdomain/cname\n    if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):\n        return server_error_404_subdomain(request, template_name)\n\n    # Return the default 404 page generated by Read the Docs\n    r = render(request, template_name)\n    r.status_code = 404\n    return r\n\n\ndef server_error_404_subdomain(request, template_name='404.html'):\n    \"\"\"\n    Handler for 404 pages on subdomains.\n\n    Check if the project associated has a custom ``404.html`` and serve this\n    page. First search for a 404 page in the current version, then continues\n    with the default version and finally, if none of them are found, the Read\n    the Docs default page (Maze Found) is rendered by Django and served.\n    \"\"\"\n\n    def resolve_404_path(project, version_slug=None, language=None, filename='404.html'):\n        \"\"\"\n        Helper to resolve the path of ``404.html`` for project.\n\n        The resolution is based on ``project`` object, version slug and\n        language.\n\n        :returns: tuple containing the (basepath, filename)\n        :rtype: tuple\n        \"\"\"\n        filename = resolve_path(\n            project,\n            version_slug=version_slug,\n            language=language,\n            filename=filename,\n            subdomain=True,  # subdomain will make it a \"full\" path without a URL prefix\n        )\n\n        # This breaks path joining, by ignoring the root when given an \"absolute\" path\n        if filename[0] == '/':\n            filename = filename[1:]\n\n        version = None\n        if version_slug:\n            version_qs = project.versions.filter(slug=version_slug)\n            if version_qs.exists():\n                version = version_qs.first()\n\n        private = any([\n            version and version.privacy_level == PRIVATE,\n            not version and project.privacy_level == PRIVATE,\n        ])\n        if private:\n            symlink = PrivateSymlink(project)\n        else:\n            symlink = PublicSymlink(project)\n        basepath = symlink.project_root\n        fullpath = os.path.join(basepath, filename)\n        return (basepath, filename, fullpath)\n\n    project, full_path = project_and_path_from_request(request, request.get_full_path())\n\n    if project:\n        language = None\n        version_slug = None\n        schema, netloc, path, params, query, fragments = urlparse(full_path)\n        if not project.single_version:\n            language, version_slug, path = language_and_version_from_path(path)\n\n        # Firstly, attempt to serve the 404 of the current version (version_slug)\n        # Secondly, try to serve the 404 page for the default version\n        # (project.get_default_version())\n        for slug in (version_slug, project.get_default_version()):\n            for tryfile in ('404.html', '404/index.html'):\n                basepath, filename, fullpath = resolve_404_path(project, slug, language, tryfile)\n                if os.path.exists(fullpath):\n                    log.debug(\n                        'serving 404.html page current version: [project: %s] [version: %s]',\n                        project.slug,\n                        slug,\n                    )\n                    r = static_serve(request, filename, basepath)\n                    r.status_code = 404\n                    return r\n\n    # Finally, return the default 404 page generated by Read the Docs\n    r = render(request, template_name)\n    r.status_code = 404\n    return r\n\n\ndef do_not_track(request):\n    dnt_header = request.META.get('HTTP_DNT')\n\n    # https://w3c.github.io/dnt/drafts/tracking-dnt.html#status-representation\n    return JsonResponse(  # pylint: disable=redundant-content-type-for-json-response\n        {\n            'policy': 'https://docs.readthedocs.io/en/latest/privacy-policy.html',\n            'same-party': [\n                'readthedocs.org',\n                'readthedocs.com',\n                'readthedocs.io',           # .org Documentation Sites\n                'readthedocs-hosted.com',   # .com Documentation Sites\n            ],\n            'tracking': 'N' if dnt_header == '1' else 'T',\n        }, content_type='application/tracking-status+json',\n    )\n", "path": "readthedocs/core/views/__init__.py"}]}