1
0
mirror of https://github.com/django/django.git synced 2025-06-08 13:09:13 +00:00

[3.2.x] Fixed #20423 -- Doc'd that DTL variable names may not be a number.

Backport of 7587139d35b630a19fdc55a5f3789475e5ed26c8 from master
This commit is contained in:
tim-mccurrach 2021-02-26 20:02:37 +00:00 committed by Mariusz Felisiak
parent 230d5b16b2
commit 7e6e822162

View File

@ -79,10 +79,10 @@ Variables
Variables look like this: ``{{ variable }}``. When the template engine Variables look like this: ``{{ variable }}``. When the template engine
encounters a variable, it evaluates that variable and replaces it with the encounters a variable, it evaluates that variable and replaces it with the
result. Variable names consist of any combination of alphanumeric characters result. Variable names consist of any combination of alphanumeric characters
and the underscore (``"_"``) but may not start with an underscore. The dot and the underscore (``"_"``) but may not start with an underscore, and may not
(``"."``) also appears in variable sections, although that has a special be a number. The dot (``"."``) also appears in variable sections, although that
meaning, as indicated below. Importantly, *you cannot have spaces or has a special meaning, as indicated below. Importantly, *you cannot have spaces
punctuation characters in variable names.* or punctuation characters in variable names.*
Use a dot (``.``) to access attributes of a variable. Use a dot (``.``) to access attributes of a variable.