1

How do i parse JSON strings using Django template library. I can parse it using javascript in my template, but I would like to parse the json in the template library when it is rendered by the server. Is there a way to do it. - Amey Kanade

1 Answer 1

1

I think you actually mean you parse JSON data using javascript not "in your template" but on the client side. Anyway, if you want to use JSON data in your template, why not process it in the view that provides variables to the template?

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

1 Comment

I'm assuming that Amey wanted to return multiple values to the template. The right way to go about this could be to return a dictionary rather than JSON, as per stackoverflow.com/questions/1541757/… - this depends on the complexity of the data to be returned, however.

Your Answer

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