I can do this to display the template.
>>> from django.template import Context, Template >>> t = Template("My name is {{ my_name }}.") >>> c = Context({"my_name": "Adrian"}) >>> t.render(c) u'My name is Adrian.'
Now I would like to take the created template, and get the context from this. Sort of:
>>> t.reverse_render('My name is Adrian.') {"my_name": "Adrian"}
Is that even a good idea?
UPDATE: The reason I want to do this is because I get XML with a well-defined structure, and I think that retrieving data this way would be a lot easier than manually parsing XML.
I use an XML template to send a response, and I wondered if I could handle the request in the same way, but vice versa.
source share