diff --git a/django/views/csrf.py b/django/views/csrf.py index 27e7b5ca37..83377b1832 100644 --- a/django/views/csrf.py +++ b/django/views/csrf.py @@ -60,14 +60,14 @@ CSRF_FAILURE_TEMPLATE = """

In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's + href="https://docs.djangoproject.com/en/{{ docs_version }}/ref/csrf/">Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure:

-

You're seeing the help section of this page because you have DEBUG = +

You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.

diff --git a/django/views/templates/technical_404.html b/django/views/templates/technical_404.html index bc0858bba2..694309aa13 100644 --- a/django/views/templates/technical_404.html +++ b/django/views/templates/technical_404.html @@ -61,7 +61,7 @@

{% if request_path %} The current path, {{ request_path }},{% else %} - The empty path{% endif %} didn't match any of these. + The empty path{% endif %} didn’t match any of these.

{% else %}

{{ reason }}

@@ -70,7 +70,7 @@

- You're seeing this error because you have DEBUG = True in + You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

diff --git a/django/views/templates/technical_500.html b/django/views/templates/technical_500.html index a384c10b9a..57d07eb933 100644 --- a/django/views/templates/technical_500.html +++ b/django/views/templates/technical_500.html @@ -474,7 +474,7 @@ Exception Value: {{ exception_value|force_escape }} {% if not is_email %}

- You're seeing this error because you have DEBUG = True in your + You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.

diff --git a/django/views/templates/technical_500.txt b/django/views/templates/technical_500.txt index f06a1a499e..71a6e150d8 100644 --- a/django/views/templates/technical_500.txt +++ b/django/views/templates/technical_500.txt @@ -59,7 +59,7 @@ Using settings module {{ settings.SETTINGS_MODULE }}{% for k, v in settings.item {{ k }} = {{ v|stringformat:"r" }}{% endfor %} {% if not is_email %} -You're seeing this error because you have DEBUG = True in your +You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code. {% endif %} diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index c3ae2cc600..1276f061fa 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -113,13 +113,13 @@ class DebugViewTests(SimpleTestCase): def test_404(self): response = self.client.get('/raises404/') self.assertEqual(response.status_code, 404) - self.assertContains(response, "not-in-urls, didn't match", status_code=404) + self.assertContains(response, 'not-in-urls, didn’t match', status_code=404) def test_404_not_in_urls(self): response = self.client.get('/not-in-urls') self.assertNotContains(response, "Raised by:", status_code=404) self.assertContains(response, "Django tried these URL patterns", status_code=404) - self.assertContains(response, "not-in-urls, didn't match", status_code=404) + self.assertContains(response, 'not-in-urls, didn’t match', status_code=404) # Pattern and view name of a RegexURLPattern appear. self.assertContains(response, r"^regex-post/(?P<pk>[0-9]+)/$", status_code=404) self.assertContains(response, "[name='regex-post']", status_code=404) @@ -130,7 +130,7 @@ class DebugViewTests(SimpleTestCase): @override_settings(ROOT_URLCONF=WithoutEmptyPathUrls) def test_404_empty_path_not_in_urls(self): response = self.client.get('/') - self.assertContains(response, "The empty path didn't match any of these.", status_code=404) + self.assertContains(response, 'The empty path didn’t match any of these.', status_code=404) def test_technical_404(self): response = self.client.get('/technical404/')