[Python] Replacing a character in Django template

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I want to change & to and in the my page's meta description.

    This is what I tried

    {% if '&' in dj.name %}
    {{ dj.name.replace('&', 'and') }}
    {% else %}
    {{ dj.name }}
    {% endif %}


    This doesn't work. It still shows as &

    Continue reading...

Compartilhe esta Página