In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags:
<ul>
<% for @item in @items -%>
<li><%= @item %></li>
<% end -%>
</ul>
becomes:
<ul>
<li>apple</li>
<li>banana</li>
<li>cacao</li>
</ul>
Is there a way to do this in Django? (Disclosure: I’m generating a csv file with Django)
Edit: Clarified that the newlines I’m hunting down are the ones left behind after the template tags.
The closest I’ve found to what you’re looking for (I’m looking for the same thing) is talk about a future patch, here: http://code.djangoproject.com/ticket/2594.
Unfortunately, it looks like there’s not much you can do until they merge that patch in.