{% if media.code %} {{ media.code|safe }} {% else %} {% if media.external_url %} {% endif %} {% endif %}