Django: Storing templates in DB: Define API (variables in context)
<p>I want to store django templates in the database and make them editable for via web.</p>

<p>Next, I want to define template types: A template type defines the allowed variables of the context.</p>

<p>Examples:</p>

<ul>
<li>Invoice-Template-Type gets these variables: customer_name, invoice_id, ...</li>
<li>Voucher-Template-Type gets these variables: voucher_id, voucher_amount, ...</li>
</ul>

<p>The people how edit the templates (stored in db, edit via web) should see the available variables and get a warning if they use variables which are unknown.</p>

<p>How to get this done or am I reinventing the wheel?</p>