[Fixed]-Send a list of string elements in Django

1πŸ‘

βœ…

Can you tell me whether the mistake is when you render the first time the view, or is an ajax call?, I think you are doing ajax call, then can you debug the django process, and write here what are the datas that you recover of your database, please?.

In addition, can you put the json serializer that you are using please?

If you try the next code, you can see the problem is not unicode:

         import json
         json.dumps([unicode(i) for i in range(10)])

result: '["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]'

try send the above data, and tell us the result please. Thanks!

πŸ‘€JuanB

0πŸ‘

Use β€œ|safe”

something like this in your template.

{{ variable_name | safe }}
πŸ‘€Taxellool

Leave a comment