# Dica 09 - Aplicando djhtml

[![](/files/-MfuAP0TTmVUwSHDjaRn)](https://youtu.be/23mdIXcUp_o)

[djhtml](https://github.com/rtts/djhtml)

**Importante:** remova a `\` no meio das tags.

![](/files/5yQAAuqmpHdOp0r1qaxa)

```
pip install djhtml
pip freeze | grep djhtml >> requirements.txt
```

Antes:

```html
{\% extends "base.html" %}

{\% block content %}
  <h1 class="text-2xl font-bold">Conteúdo</h1>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vero tenetur repudiandae id animi, labore magni cumque tempore eum culpa esse exercitationem modi est enim sunt in maxime aut quo deleniti!</p>
  {\% if 'a' == 'a' %}
  {\% if '1' == '1' %}
  <span>A1</span>
  {\% endif %}
  {\% endif %}
{\% endblock content %}
```

```
find backend -name "*.html" | xargs djhtml -t 2 -i
```

Depois:

```html
{\% extends "base.html" %}

{\% block content %}
  <h1 class="text-2xl font-bold">Conteúdo</h1>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vero tenetur repudiandae id animi, labore magni cumque tempore eum culpa esse exercitationem modi est enim sunt in maxime aut quo deleniti!</p>
  {\% if 'a' == 'a' %}
    {\% if '1' == '1' %}
      <span>A1</span>
    {\% endif %}
  {\% endif %}
{\% endblock content %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.dicas-de-django.com.br/069-09-djhtml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
