I'm logging the solution here, in case someone else needs this: The correct statement is:
return HttpResponse(''.join(raw_template), mimetype='text/plain')
I.e., the raw_template variable is actually a list of strings, and has
to be translated into one simple string in order for HttpResponse() to
display the template.
/LarS

