djangosnippets.org: Latest snippets posted by nkwentihttps://djangosnippets.org/users/nkwenti/2008-06-27T14:44:45.527480-05:00nkwentiCreate variables within templates
2008-06-27T14:44:45.527480-05:00nkwentihttps://djangosnippets.org/snippets/829/<p>Here is a Django template tag that allows you to create complex variables specified in JSON format within a template.</p>
<p>It enables you to do stuff like:</p>
<pre><code>{% var as person %}
{
"firstName": "John",
"lastName": "Smith",
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": 10021 …</code></pre>
Freely redistributable