No
Why would there be such a specific tag and why it would be used?
You can add one easily
# file: literal_eval.py
import ast
def literal_eval(value):
return ast.literal_eval(value)
from django import template
register = template.Library()
register.filter('literal_eval', literal_eval)
and you can use it like this in template
{% load literal_eval %}
{{ some_str|literal_eval }}
now that leads to the question "Why?" what you will do with this?
Edit: OP said "he wants to deserialize some python dict saved as varchar", in that case template is not the place to do it, first convert text to dict and then pass it to template.
and better still rethink what is being done, saving dict repr
is not the way to serialize and using literal_eval
is not the way to de-serialize dicts, use json.dumps
or such format to put dict into database and use json.loads
to convert it back to dict. You can use pickle also but I would not recommend it.