javascript - Rendering JSON in template DJANGO -
This is working on my local machine, but when I run it on my VPS, it is always a Javascript throws the formula:
var post_array = [['title': U 'How to hire a designer', 'URL': U '/ post / how-to-hire- A-Designer ',' Text ': U' Laurem Ipsum Dollar Seat AMT, Publisher Adipisive Elite Morris Altysies Lobertis Eros, Tristique Said Fallavine Non Fuse Nasi Purus, Laboratories Non Sagittis AC, Venetis Ezest It For no time, but it is very easy, but it is really the most important. In the semi-finals Dennis now exits from now, for the sake of life, ultrasonic radish sapiens. How to achieve this, as you tell me, I'm waiting for a week at my house or for my home. When Morbi asked about his children, it is not easy, the most important thing is that I love my children. Nal Leo Archu, Matisse NC, Matisse in Vannitis Non Sepian. The intervals and the most important aspects of men's women have been told about. There are a few different words on the Doonic Dignisim Actis Fellmum Dexterity Strength Duus Roncus Eros Sapian Molly. Vivamas asked a question. 1, 'comment_count': 15, 'date': {'year': 2014, 'day': 10, 'month': 'September': 'Integer EU flood ...', 'share': 0, 'Post_ID '}}]; The json value in my local machine (where no error is found) does not show the 'U' sign in front of them.
How do I pass a dictionary for reference: return render (request, 'index.html', {'post_objs': securestring (feedback)}, Content_type = 'text / html') How do I provide the template:
var post_array = {{post_objs | Safe}}; Any ideas?
You json.dumps () . Like this: import json return render (request, 'index.html', {'post_objs': json.dumps (feedback)}, content_type = 'text / html')
Comments
Post a Comment