0

I'm not sure if this is possible, but I really appreciate it if there's such a thing.

I have a json object that contains a json string that another program returns which is a html code. However, when I render it to the django template, it's just a big trunk of string. I wonder if there's such tool in python/django that can convert a string into "html format" text. Thanks.

Edit: I use json.loads() to load the output of the other program, and extract the useful information, then return it to template. In template I simply use django template syntax like {{ v.response }} to show it. After that the page looks like this:

enter image description here

2
  • 1
    Please include a sample of the data, and of the resulting output. How are you including the data in your template? Commented Feb 12, 2013 at 22:42
  • @MartijnPieters: I added some more description in Edit. Commented Feb 12, 2013 at 22:51

1 Answer 1

1

Assuming you know the string is safe, you can mark as such so that the template engine will not auto-escape it: try {{ v.response|safe }}.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.