How to generate a comma-separated list in Jinja2? May 20, 2018 From a list directly: {{ somelist|join(",") }} From a list of objects: {% for x in somelist %}{{ x.xyz }}{% if not loop.last %},{% endif %}{% endfor %}