Outputting escaped characters in django templates
I want to use the django templating system to output csv like data which looks like;

    !connection%block
    !dosomething
    !dosomethingelse
    My,Header,Row,Which,Is,Comma,Seperated
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    !Footerblock
    !that has footer information

The [documentation][1] for CSVs recommends either using the csv module or a template. My particular needs are better suited for a template because some of the model fields need some manipulation using a tag library I have created. 

My view simply returns

    return render_to_response('trans.csv', {'transations': Transactions.objects.all(),  mimetype='text/csv')

However the rendered template has no way of actually outputting new line characters so the entire file is one long line! There must be a way of outputting a \n char ...


  [1]: http://docs.djangoproject.com/en/dev/howto/outputting-csv/?from=olddocs
Outputting escaped characters in django templates
===

I want to use the django templating system to output csv like data which looks like;

    !connection%block
    !dosomething
    !dosomethingelse
    My,Header,Row,Which,Is,Comma,Seperated
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    All,My,Comma,Seperated,Data
    !Footerblock
    !that has footer information

The [documentation][1] for CSVs recommends either using the csv module or a template. My particular needs are better suited for a template because some of the model fields need some manipulation using a tag library I have created. 

My view simply returns

    return render_to_response('trans.csv', {'transations': Transactions.objects.all(),  mimetype='text/csv')

However the rendered template has no way of actually outputting new line characters so the entire file is one long line! There must be a way of outputting a \n char ...


  [1]: http://docs.djangoproject.com/en/dev/howto/outputting-csv/?from=olddocs