[Python] Removing quotes in a Django template

Discussão em 'Python' iniciado por Stack, Agosto 3, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Django template that looks like this:

    <div id="objects">
    <b>Ingredients:</b>
    <small>
    {% for obj in result.object.list_objects|slice:":10" %}
    .{{ obj }}
    {% endfor %}
    ......
    </small>
    </div>


    I am trying to output a simple list but when I loop through these elements in the template, the output is unfortunately in single quotes for each object. I am new to Django templates and have tried using a few methods like safe and escape. But the single quotes remain. Is there a way in Django to strip out that specific character when loading the data?

    Continue reading...

Compartilhe esta Página