summaryrefslogtreecommitdiff
path: root/django/views/debug.py
diff options
context:
space:
mode:
authorTimothy Allen <flipper@peregrinesalon.com>2017-08-07 10:33:55 -0400
committerTim Graham <timograham@gmail.com>2017-08-07 10:33:55 -0400
commit5fe9b7b40acf73da3dd91c56b3534f0bab1fb3d0 (patch)
tree7a10e7db35de62b5be3ed71cdd4d432c59ffda98 /django/views/debug.py
parent0a24714b260cfbf955bb093bad1a77393579e783 (diff)
Fixed #28457 -- Updated the design of the 'Congrats' page for new Django projects.
Developed by Timothy Allen and Chad Whitman of The Wharton School with shepherding from Aymeric Augustin and Collin Anderson.
Diffstat (limited to 'django/views/debug.py')
-rw-r--r--django/views/debug.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 15566a25cd..9823b7dd8c 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -14,13 +14,16 @@ from django.utils import timezone
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_text
from django.utils.module_loading import import_string
-from django.utils.translation import gettext as _
+from django.utils.version import get_docs_version
# Minimal Django templates engine to render the error templates
# regardless of the project's TEMPLATES setting. Templates are
# read directly from the filesystem so that the error handler
# works even if the template loader is broken.
-DEBUG_ENGINE = Engine(debug=True)
+DEBUG_ENGINE = Engine(
+ debug=True,
+ libraries={'i18n': 'django.templatetags.i18n'},
+)
HIDDEN_SETTINGS = re.compile('API|TOKEN|KEY|SECRET|PASS|SIGNATURE', flags=re.IGNORECASE)
@@ -504,16 +507,7 @@ def default_urlconf(request):
with Path(CURRENT_DIR, 'templates', 'default_urlconf.html').open() as fh:
t = DEBUG_ENGINE.from_string(fh.read())
c = Context({
- "title": _("Welcome to Django"),
- "heading": _("It worked!"),
- "subheading": _("Congratulations on your first Django-powered page."),
- "instructions": _(
- "Next, start your first app by running <code>python manage.py startapp [app_label]</code>."
- ),
- "explanation": _(
- "You're seeing this message because you have <code>DEBUG = True</code> in your "
- "Django settings file and you haven't configured any URLs. Get to work!"
- ),
+ 'version': get_docs_version(),
})
return HttpResponse(t.render(c), content_type='text/html')