[1.11.x] Fixed -- Doc'd how to compute path to built-in widget template directories.

Backport of 7f238097c0 from master
This commit is contained in:
Windson yang 2017-06-06 05:26:49 +08:00 committed by Tim Graham
parent 834d57b4de
commit b373812b0b
1 changed files with 5 additions and 3 deletions
docs/ref/forms

View File

@ -93,9 +93,11 @@ Using this renderer along with the built-in widget templates requires either:
#. ``'django.forms'`` in :setting:`INSTALLED_APPS` and at least one engine #. ``'django.forms'`` in :setting:`INSTALLED_APPS` and at least one engine
with :setting:`APP_DIRS=True <TEMPLATES-APP_DIRS>`. with :setting:`APP_DIRS=True <TEMPLATES-APP_DIRS>`.
#. Adding the built-in widgets templates directory (``django/forms/templates`` #. Adding the built-in widgets templates directory in :setting:`DIRS
or ``django/forms/jinja2``) in :setting:`DIRS <TEMPLATES-DIRS>` of one of <TEMPLATES-DIRS>` of one of your template engines. To generate that path::
your template engines.
import django
django.__path__[0] + '/forms/templates' # or '/forms/jinja2'
Using this renderer requires you to make sure the form templates your project Using this renderer requires you to make sure the form templates your project
needs can be located. needs can be located.