User defined Template

Hi,
Maybe this is a Stupid question but i cant find anything on the Internet. I Think i’m describing my Problem wrong, can anyone give me some Keywords what I need to google for?

So here is my Problem:

Iam generating a PDF with the template engine and for Customization I want to be able to edit the text of this PDF. So I created a model with all the fields… but in one of the text parts some data for the particular PDF is added. I did this like so:

text text {{ data }} text text text

So when I save this string into a model.TextField() and insert it into my template this part will be escaped (Of course!).

So how can I make this text Customizable and decide in the TextField where the Variable goes?
I could just use str.replace but maybe there is a more elegant way to do this?

I’m not sure I’m really following what you’re trying to explain here - if I’m understanding you correctly the net effect of what you’re trying to accomplish is to render a string - and then using that output as yet another string to be rendered.

Am I close to understanding the root issue? If so, see this response for an idea of how to do that - Using a string as template in CBV - #4 by carltongibson

If I’m not, a more specific example may be helpful to illustrate your question.