summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephenfinucane@hotmail.com>2018-09-11 13:14:53 -0600
committerTim Graham <timograham@gmail.com>2018-09-11 15:15:14 -0400
commit9c88826ff9724c6bb42d403a7f436de6f51ed553 (patch)
treed016db207da900d4b99ff2a83c12b3d545d782eb
parent5bbcf83fce5e5fb1d7369f2bfb81b7e06a4b1a85 (diff)
downloaddjango-9c88826ff9724c6bb42d403a7f436de6f51ed553.tar.gz
[2.1.x] Emphasized that TemplatesSetting must be used to override widget templates.
Backport of 25f4302349db71d73a15ff8f3872956fc21a0f84 from master
-rw-r--r--docs/howto/overriding-templates.txt5
-rw-r--r--docs/ref/forms/renderers.txt8
2 files changed, 10 insertions, 3 deletions
diff --git a/docs/howto/overriding-templates.txt b/docs/howto/overriding-templates.txt
index f46dd1d85f..e7c65dd354 100644
--- a/docs/howto/overriding-templates.txt
+++ b/docs/howto/overriding-templates.txt
@@ -12,6 +12,11 @@ the default Django template loader will try to load the template from the
project-level directory first. In other words, :setting:`DIRS <TEMPLATES-DIRS>`
is searched before :setting:`APP_DIRS <TEMPLATES-APP_DIRS>`.
+.. seealso::
+
+ Read :ref:`overriding-built-in-widget-templates` if you're looking to
+ do that.
+
Overriding from the project's templates directory
=================================================
diff --git a/docs/ref/forms/renderers.txt b/docs/ref/forms/renderers.txt
index 71f0661f94..58caa08c32 100644
--- a/docs/ref/forms/renderers.txt
+++ b/docs/ref/forms/renderers.txt
@@ -114,6 +114,8 @@ Some widgets add further information to the context. For instance, all widgets
that subclass ``Input`` defines ``widget['type']`` and :class:`.MultiWidget`
defines ``widget['subwidgets']`` for looping purposes.
+.. _overriding-built-in-widget-templates:
+
Overriding built-in widget templates
====================================
@@ -123,6 +125,6 @@ Each widget has a ``template_name`` attribute with a value such as
``input.html`` by defining ``django/forms/widgets/input.html``, for example.
See :ref:`built-in widgets` for the name of each widget's template.
-If you use the :class:`TemplatesSetting` renderer, overriding widget templates
-works the same as overriding any other template in your project. You can't
-override built-in widget templates using the other built-in renderers.
+To override widget templates, you must use the :class:`TemplatesSetting`
+renderer. Then overriding widget templates works :doc:`the same as
+</howto/overriding-templates>` overriding any other template in your project.