We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
List of redirects doesn't say which URLs are being redirected (if exact redirects)
## Details
- Project URL: https://readthedocs.org/projects/bigchaindb/
- List of project redirects (URL): https://readthedocs.org/dashboard/bigchaindb/redirects/
## Expected Result

When I make a bunch of redirects, I would expect the list of exact redirects to say the URL being redirected (and maybe where). Maybe the list would be simple but I'd be able to click on each item to see the details (such as the URL which get redirected and where).
## Actual Result

The actual list of redirects doesn't say anything about each one, other than it's an "Exact Redirect" (as seen in the image below). Also, I can't click on a redirect to find out more information about it.

What if I want to remove one (but only one) redirect? How can I pick the one to remove?

<hr>

![list_of_redirects](https://cloud.githubusercontent.com/assets/1210951/18984645/06cac79a-86f4-11e6-9d5b-7854c4959615.png)


--- 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/redirects/models.py`
Content:
```
1 """Django models for the redirects app."""
2 
3 from __future__ import absolute_import
4 from builtins import object
5 from django.db import models
6 from django.utils.encoding import python_2_unicode_compatible
7 from django.utils.translation import ugettext
8 from django.utils.translation import ugettext_lazy as _
9 import logging
10 import re
11 
12 from readthedocs.core.resolver import resolve_path
13 from readthedocs.projects.models import Project
14 from .managers import RedirectManager
15 
16 
17 log = logging.getLogger(__name__)
18 
19 
20 HTTP_STATUS_CHOICES = (
21     (301, _('301 - Permanent Redirect')),
22     (302, _('302 - Temporary Redirect')),
23 )
24 
25 STATUS_CHOICES = (
26     (True, _('Active')),
27     (False, _('Inactive')),
28 )
29 
30 TYPE_CHOICES = (
31     ('prefix', _('Prefix Redirect')),
32     ('page', _('Page Redirect')),
33     ('exact', _('Exact Redirect')),
34     ('sphinx_html', _('Sphinx HTMLDir -> HTML')),
35     ('sphinx_htmldir', _('Sphinx HTML -> HTMLDir')),
36     # ('advanced', _('Advanced')),
37 )
38 
39 from_url_helptext = _('Absolute path, excluding the domain. '
40                       'Example: <b>/docs/</b>  or <b>/install.html</b>'
41                       )
42 to_url_helptext = _('Absolute or relative URL. Examples: '
43                     '<b>/tutorial/install.html</b>'
44                     )
45 redirect_type_helptext = _('The type of redirect you wish to use.')
46 
47 
48 @python_2_unicode_compatible
49 class Redirect(models.Model):
50 
51     """A HTTP redirect associated with a Project."""
52 
53     project = models.ForeignKey(Project, verbose_name=_('Project'),
54                                 related_name='redirects')
55 
56     redirect_type = models.CharField(_('Redirect Type'), max_length=255, choices=TYPE_CHOICES,
57                                      help_text=redirect_type_helptext)
58 
59     from_url = models.CharField(_('From URL'), max_length=255,
60                                 db_index=True, help_text=from_url_helptext, blank=True)
61 
62     to_url = models.CharField(_('To URL'), max_length=255,
63                               db_index=True, help_text=to_url_helptext, blank=True)
64 
65     http_status = models.SmallIntegerField(_('HTTP Status'),
66                                            choices=HTTP_STATUS_CHOICES,
67                                            default=301)
68     status = models.BooleanField(choices=STATUS_CHOICES, default=True)
69 
70     create_dt = models.DateTimeField(auto_now_add=True)
71     update_dt = models.DateTimeField(auto_now=True)
72 
73     objects = RedirectManager()
74 
75     class Meta(object):
76         verbose_name = _('redirect')
77         verbose_name_plural = _('redirects')
78         ordering = ('-update_dt',)
79 
80     def __str__(self):
81         if self.redirect_type == 'prefix':
82             return ugettext('Prefix Redirect:') + ' %s ->' % self.from_url
83         elif self.redirect_type == 'page':
84             return ugettext('Page Redirect:') + ' %s -> %s' % (
85                 self.from_url,
86                 self.to_url)
87         return ugettext('Redirect: %s' % self.get_redirect_type_display())
88 
89     def get_full_path(self, filename, language=None, version_slug=None):
90         """
91         Return a full path for a given filename.
92 
93         This will include version and language information. No protocol/domain
94         is returned.
95         """
96         # Handle explicit http redirects
97         if re.match('^https?://', filename):
98             return filename
99 
100         return resolve_path(
101             project=self.project, language=language,
102             version_slug=version_slug, filename=filename
103         )
104 
105     def get_redirect_path(self, path, language=None, version_slug=None):
106         method = getattr(self, 'redirect_{type}'.format(
107             type=self.redirect_type))
108         return method(path, language=language, version_slug=version_slug)
109 
110     def redirect_prefix(self, path, language=None, version_slug=None):
111         if path.startswith(self.from_url):
112             log.debug('Redirecting %s', self)
113             cut_path = re.sub('^%s' % self.from_url, '', path)
114             to = self.get_full_path(
115                 filename=cut_path,
116                 language=language,
117                 version_slug=version_slug)
118             return to
119 
120     def redirect_page(self, path, language=None, version_slug=None):
121         if path == self.from_url:
122             log.debug('Redirecting %s', self)
123             to = self.get_full_path(
124                 filename=self.to_url.lstrip('/'),
125                 language=language,
126                 version_slug=version_slug)
127             return to
128 
129     def redirect_exact(self, path, **__):
130         if path == self.from_url:
131             log.debug('Redirecting %s', self)
132             return self.to_url
133         # Handle full sub-level redirects
134         if '$rest' in self.from_url:
135             match = self.from_url.split('$rest')[0]
136             if path.startswith(match):
137                 cut_path = re.sub('^%s' % match, self.to_url, path)
138                 return cut_path
139 
140     def redirect_sphinx_html(self, path, language=None, version_slug=None):
141         for ending in ['/', '/index.html']:
142             if path.endswith(ending):
143                 log.debug('Redirecting %s', self)
144                 path = path[1:]  # Strip leading slash.
145                 to = re.sub(ending + '$', '.html', path)
146                 return self.get_full_path(
147                     filename=to,
148                     language=language,
149                     version_slug=version_slug)
150 
151     def redirect_sphinx_htmldir(self, path, language=None, version_slug=None):
152         if path.endswith('.html'):
153             log.debug('Redirecting %s', self)
154             path = path[1:]  # Strip leading slash.
155             to = re.sub('.html$', '/', path)
156             return self.get_full_path(
157                 filename=to,
158                 language=language,
159                 version_slug=version_slug)
160
```
--- 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/redirects/models.py b/readthedocs/redirects/models.py
--- a/readthedocs/redirects/models.py
+++ b/readthedocs/redirects/models.py
@@ -78,13 +78,30 @@
         ordering = ('-update_dt',)
 
     def __str__(self):
-        if self.redirect_type == 'prefix':
-            return ugettext('Prefix Redirect:') + ' %s ->' % self.from_url
-        elif self.redirect_type == 'page':
-            return ugettext('Page Redirect:') + ' %s -> %s' % (
-                self.from_url,
-                self.to_url)
-        return ugettext('Redirect: %s' % self.get_redirect_type_display())
+        redirect_text = '{type}: {from_to_url}'
+        if self.redirect_type in ['prefix', 'page', 'exact']:
+            return redirect_text.format(
+                type=self.get_redirect_type_display(),
+                from_to_url=self.get_from_to_url_display()
+            )
+        return ugettext('Redirect: {}'.format(
+            self.get_redirect_type_display())
+        )
+
+    def get_from_to_url_display(self):
+        if self.redirect_type in ['prefix', 'page', 'exact']:
+            from_url = self.from_url
+            to_url = self.to_url
+            if self.redirect_type == 'prefix':
+                to_url = '/{lang}/{version}/'.format(
+                    lang=self.project.language,
+                    version=self.project.default_version
+                )
+            return '{from_url} -> {to_url}'.format(
+                from_url=from_url,
+                to_url=to_url
+            )
+        return ''
 
     def get_full_path(self, filename, language=None, version_slug=None):
         """

{"golden_diff": "diff --git a/readthedocs/redirects/models.py b/readthedocs/redirects/models.py\n--- a/readthedocs/redirects/models.py\n+++ b/readthedocs/redirects/models.py\n@@ -78,13 +78,30 @@\n         ordering = ('-update_dt',)\n \n     def __str__(self):\n-        if self.redirect_type == 'prefix':\n-            return ugettext('Prefix Redirect:') + ' %s ->' % self.from_url\n-        elif self.redirect_type == 'page':\n-            return ugettext('Page Redirect:') + ' %s -> %s' % (\n-                self.from_url,\n-                self.to_url)\n-        return ugettext('Redirect: %s' % self.get_redirect_type_display())\n+        redirect_text = '{type}: {from_to_url}'\n+        if self.redirect_type in ['prefix', 'page', 'exact']:\n+            return redirect_text.format(\n+                type=self.get_redirect_type_display(),\n+                from_to_url=self.get_from_to_url_display()\n+            )\n+        return ugettext('Redirect: {}'.format(\n+            self.get_redirect_type_display())\n+        )\n+\n+    def get_from_to_url_display(self):\n+        if self.redirect_type in ['prefix', 'page', 'exact']:\n+            from_url = self.from_url\n+            to_url = self.to_url\n+            if self.redirect_type == 'prefix':\n+                to_url = '/{lang}/{version}/'.format(\n+                    lang=self.project.language,\n+                    version=self.project.default_version\n+                )\n+            return '{from_url} -> {to_url}'.format(\n+                from_url=from_url,\n+                to_url=to_url\n+            )\n+        return ''\n \n     def get_full_path(self, filename, language=None, version_slug=None):\n         \"\"\"\n", "issue": "List of redirects doesn't say which URLs are being redirected (if exact redirects)\n## Details\n- Project URL: https://readthedocs.org/projects/bigchaindb/\n- List of project redirects (URL): https://readthedocs.org/dashboard/bigchaindb/redirects/\n## Expected Result\n\nWhen I make a bunch of redirects, I would expect the list of exact redirects to say the URL being redirected (and maybe where). Maybe the list would be simple but I'd be able to click on each item to see the details (such as the URL which get redirected and where).\n## Actual Result\n\nThe actual list of redirects doesn't say anything about each one, other than it's an \"Exact Redirect\" (as seen in the image below). Also, I can't click on a redirect to find out more information about it.\n\nWhat if I want to remove one (but only one) redirect? How can I pick the one to remove?\n\n<hr>\n\n![list_of_redirects](https://cloud.githubusercontent.com/assets/1210951/18984645/06cac79a-86f4-11e6-9d5b-7854c4959615.png)\n\n", "before_files": [{"content": "\"\"\"Django models for the redirects app.\"\"\"\n\nfrom __future__ import absolute_import\nfrom builtins import object\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom django.utils.translation import ugettext\nfrom django.utils.translation import ugettext_lazy as _\nimport logging\nimport re\n\nfrom readthedocs.core.resolver import resolve_path\nfrom readthedocs.projects.models import Project\nfrom .managers import RedirectManager\n\n\nlog = logging.getLogger(__name__)\n\n\nHTTP_STATUS_CHOICES = (\n    (301, _('301 - Permanent Redirect')),\n    (302, _('302 - Temporary Redirect')),\n)\n\nSTATUS_CHOICES = (\n    (True, _('Active')),\n    (False, _('Inactive')),\n)\n\nTYPE_CHOICES = (\n    ('prefix', _('Prefix Redirect')),\n    ('page', _('Page Redirect')),\n    ('exact', _('Exact Redirect')),\n    ('sphinx_html', _('Sphinx HTMLDir -> HTML')),\n    ('sphinx_htmldir', _('Sphinx HTML -> HTMLDir')),\n    # ('advanced', _('Advanced')),\n)\n\nfrom_url_helptext = _('Absolute path, excluding the domain. '\n                      'Example: <b>/docs/</b>  or <b>/install.html</b>'\n                      )\nto_url_helptext = _('Absolute or relative URL. Examples: '\n                    '<b>/tutorial/install.html</b>'\n                    )\nredirect_type_helptext = _('The type of redirect you wish to use.')\n\n\n@python_2_unicode_compatible\nclass Redirect(models.Model):\n\n    \"\"\"A HTTP redirect associated with a Project.\"\"\"\n\n    project = models.ForeignKey(Project, verbose_name=_('Project'),\n                                related_name='redirects')\n\n    redirect_type = models.CharField(_('Redirect Type'), max_length=255, choices=TYPE_CHOICES,\n                                     help_text=redirect_type_helptext)\n\n    from_url = models.CharField(_('From URL'), max_length=255,\n                                db_index=True, help_text=from_url_helptext, blank=True)\n\n    to_url = models.CharField(_('To URL'), max_length=255,\n                              db_index=True, help_text=to_url_helptext, blank=True)\n\n    http_status = models.SmallIntegerField(_('HTTP Status'),\n                                           choices=HTTP_STATUS_CHOICES,\n                                           default=301)\n    status = models.BooleanField(choices=STATUS_CHOICES, default=True)\n\n    create_dt = models.DateTimeField(auto_now_add=True)\n    update_dt = models.DateTimeField(auto_now=True)\n\n    objects = RedirectManager()\n\n    class Meta(object):\n        verbose_name = _('redirect')\n        verbose_name_plural = _('redirects')\n        ordering = ('-update_dt',)\n\n    def __str__(self):\n        if self.redirect_type == 'prefix':\n            return ugettext('Prefix Redirect:') + ' %s ->' % self.from_url\n        elif self.redirect_type == 'page':\n            return ugettext('Page Redirect:') + ' %s -> %s' % (\n                self.from_url,\n                self.to_url)\n        return ugettext('Redirect: %s' % self.get_redirect_type_display())\n\n    def get_full_path(self, filename, language=None, version_slug=None):\n        \"\"\"\n        Return a full path for a given filename.\n\n        This will include version and language information. No protocol/domain\n        is returned.\n        \"\"\"\n        # Handle explicit http redirects\n        if re.match('^https?://', filename):\n            return filename\n\n        return resolve_path(\n            project=self.project, language=language,\n            version_slug=version_slug, filename=filename\n        )\n\n    def get_redirect_path(self, path, language=None, version_slug=None):\n        method = getattr(self, 'redirect_{type}'.format(\n            type=self.redirect_type))\n        return method(path, language=language, version_slug=version_slug)\n\n    def redirect_prefix(self, path, language=None, version_slug=None):\n        if path.startswith(self.from_url):\n            log.debug('Redirecting %s', self)\n            cut_path = re.sub('^%s' % self.from_url, '', path)\n            to = self.get_full_path(\n                filename=cut_path,\n                language=language,\n                version_slug=version_slug)\n            return to\n\n    def redirect_page(self, path, language=None, version_slug=None):\n        if path == self.from_url:\n            log.debug('Redirecting %s', self)\n            to = self.get_full_path(\n                filename=self.to_url.lstrip('/'),\n                language=language,\n                version_slug=version_slug)\n            return to\n\n    def redirect_exact(self, path, **__):\n        if path == self.from_url:\n            log.debug('Redirecting %s', self)\n            return self.to_url\n        # Handle full sub-level redirects\n        if '$rest' in self.from_url:\n            match = self.from_url.split('$rest')[0]\n            if path.startswith(match):\n                cut_path = re.sub('^%s' % match, self.to_url, path)\n                return cut_path\n\n    def redirect_sphinx_html(self, path, language=None, version_slug=None):\n        for ending in ['/', '/index.html']:\n            if path.endswith(ending):\n                log.debug('Redirecting %s', self)\n                path = path[1:]  # Strip leading slash.\n                to = re.sub(ending + '$', '.html', path)\n                return self.get_full_path(\n                    filename=to,\n                    language=language,\n                    version_slug=version_slug)\n\n    def redirect_sphinx_htmldir(self, path, language=None, version_slug=None):\n        if path.endswith('.html'):\n            log.debug('Redirecting %s', self)\n            path = path[1:]  # Strip leading slash.\n            to = re.sub('.html$', '/', path)\n            return self.get_full_path(\n                filename=to,\n                language=language,\n                version_slug=version_slug)\n", "path": "readthedocs/redirects/models.py"}], "after_files": [{"content": "\"\"\"Django models for the redirects app.\"\"\"\n\nfrom __future__ import absolute_import\nfrom builtins import object\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom django.utils.translation import ugettext\nfrom django.utils.translation import ugettext_lazy as _\nimport logging\nimport re\n\nfrom readthedocs.core.resolver import resolve_path\nfrom readthedocs.projects.models import Project\nfrom .managers import RedirectManager\n\n\nlog = logging.getLogger(__name__)\n\n\nHTTP_STATUS_CHOICES = (\n    (301, _('301 - Permanent Redirect')),\n    (302, _('302 - Temporary Redirect')),\n)\n\nSTATUS_CHOICES = (\n    (True, _('Active')),\n    (False, _('Inactive')),\n)\n\nTYPE_CHOICES = (\n    ('prefix', _('Prefix Redirect')),\n    ('page', _('Page Redirect')),\n    ('exact', _('Exact Redirect')),\n    ('sphinx_html', _('Sphinx HTMLDir -> HTML')),\n    ('sphinx_htmldir', _('Sphinx HTML -> HTMLDir')),\n    # ('advanced', _('Advanced')),\n)\n\nfrom_url_helptext = _('Absolute path, excluding the domain. '\n                      'Example: <b>/docs/</b>  or <b>/install.html</b>'\n                      )\nto_url_helptext = _('Absolute or relative URL. Examples: '\n                    '<b>/tutorial/install.html</b>'\n                    )\nredirect_type_helptext = _('The type of redirect you wish to use.')\n\n\n@python_2_unicode_compatible\nclass Redirect(models.Model):\n\n    \"\"\"A HTTP redirect associated with a Project.\"\"\"\n\n    project = models.ForeignKey(Project, verbose_name=_('Project'),\n                                related_name='redirects')\n\n    redirect_type = models.CharField(_('Redirect Type'), max_length=255, choices=TYPE_CHOICES,\n                                     help_text=redirect_type_helptext)\n\n    from_url = models.CharField(_('From URL'), max_length=255,\n                                db_index=True, help_text=from_url_helptext, blank=True)\n\n    to_url = models.CharField(_('To URL'), max_length=255,\n                              db_index=True, help_text=to_url_helptext, blank=True)\n\n    http_status = models.SmallIntegerField(_('HTTP Status'),\n                                           choices=HTTP_STATUS_CHOICES,\n                                           default=301)\n    status = models.BooleanField(choices=STATUS_CHOICES, default=True)\n\n    create_dt = models.DateTimeField(auto_now_add=True)\n    update_dt = models.DateTimeField(auto_now=True)\n\n    objects = RedirectManager()\n\n    class Meta(object):\n        verbose_name = _('redirect')\n        verbose_name_plural = _('redirects')\n        ordering = ('-update_dt',)\n\n    def __str__(self):\n        redirect_text = '{type}: {from_to_url}'\n        if self.redirect_type in ['prefix', 'page', 'exact']:\n            return redirect_text.format(\n                type=self.get_redirect_type_display(),\n                from_to_url=self.get_from_to_url_display()\n            )\n        return ugettext('Redirect: {}'.format(\n            self.get_redirect_type_display())\n        )\n\n    def get_from_to_url_display(self):\n        if self.redirect_type in ['prefix', 'page', 'exact']:\n            from_url = self.from_url\n            to_url = self.to_url\n            if self.redirect_type == 'prefix':\n                to_url = '/{lang}/{version}/'.format(\n                    lang=self.project.language,\n                    version=self.project.default_version\n                )\n            return '{from_url} -> {to_url}'.format(\n                from_url=from_url,\n                to_url=to_url\n            )\n        return ''\n\n    def get_full_path(self, filename, language=None, version_slug=None):\n        \"\"\"\n        Return a full path for a given filename.\n\n        This will include version and language information. No protocol/domain\n        is returned.\n        \"\"\"\n        # Handle explicit http redirects\n        if re.match('^https?://', filename):\n            return filename\n\n        return resolve_path(\n            project=self.project, language=language,\n            version_slug=version_slug, filename=filename\n        )\n\n    def get_redirect_path(self, path, language=None, version_slug=None):\n        method = getattr(self, 'redirect_{type}'.format(\n            type=self.redirect_type))\n        return method(path, language=language, version_slug=version_slug)\n\n    def redirect_prefix(self, path, language=None, version_slug=None):\n        if path.startswith(self.from_url):\n            log.debug('Redirecting %s', self)\n            cut_path = re.sub('^%s' % self.from_url, '', path)\n            to = self.get_full_path(\n                filename=cut_path,\n                language=language,\n                version_slug=version_slug)\n            return to\n\n    def redirect_page(self, path, language=None, version_slug=None):\n        if path == self.from_url:\n            log.debug('Redirecting %s', self)\n            to = self.get_full_path(\n                filename=self.to_url.lstrip('/'),\n                language=language,\n                version_slug=version_slug)\n            return to\n\n    def redirect_exact(self, path, **__):\n        if path == self.from_url:\n            log.debug('Redirecting %s', self)\n            return self.to_url\n        # Handle full sub-level redirects\n        if '$rest' in self.from_url:\n            match = self.from_url.split('$rest')[0]\n            if path.startswith(match):\n                cut_path = re.sub('^%s' % match, self.to_url, path)\n                return cut_path\n\n    def redirect_sphinx_html(self, path, language=None, version_slug=None):\n        for ending in ['/', '/index.html']:\n            if path.endswith(ending):\n                log.debug('Redirecting %s', self)\n                path = path[1:]  # Strip leading slash.\n                to = re.sub(ending + '$', '.html', path)\n                return self.get_full_path(\n                    filename=to,\n                    language=language,\n                    version_slug=version_slug)\n\n    def redirect_sphinx_htmldir(self, path, language=None, version_slug=None):\n        if path.endswith('.html'):\n            log.debug('Redirecting %s', self)\n            path = path[1:]  # Strip leading slash.\n            to = re.sub('.html$', '/', path)\n            return self.get_full_path(\n                filename=to,\n                language=language,\n                version_slug=version_slug)\n", "path": "readthedocs/redirects/models.py"}]}