Q. | Can I still use the {{ and {% character sets as text in my web pages? |
A. | Yes. Django provides the templatetag tag to output character sets defined by the template to the rendered HTML. The following code shows how to use templatetag to output the {% character set:
{% templatetag openblock %} |
Q. | Is there a way to add text to a template without displaying it in the rendered file? |
A. | Yes. You can use the comment and endcomment tags. Anything between them will not get rendered. |
Q. | Is there a way to quickly remove extra white spaces from the rendered text so that the HTTP response is smaller? |
A. | Use the spaceless and endspaceless tags. The white spaces, including end-of-line characters, are removed from the HTML code between those tags. |