In your template try {{usb_data|safe}}
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/783144af-8478-408a-bdd5-0b7b5a5a1161%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On 18 Jan 2014 08:32, "Mario Gudelj" <mario....@gmail.com> wrote:
>
> In your template try {{usb_data|safe}}
.......because django escapes everything in the template by default except you ask not to. One of the methods of doing so if by using the `safe` filter like Mario suggested.
You can read the documentation on how to escape or unescape stuff in your template.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHqTbj%3DO5ysO7cmVXFg8p-aTMbHNZ5gHA4iZ8JaVzNthVjsDkQ%40mail.gmail.com.
Thats probably because you are returning the json as a context in a response with the default "text/html" mime type. Your response should have mime type as " application/javascript".
Your json data should be in the response
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BFnnTyzs3h%3Dga%3DKvPArxx2-eiCVFECVPMjqc6uYnpmO%3D2SAcw%40mail.gmail.com.
https://docs.djangoproject.com/en/1.6/ref/request-response/#usage
Actually, Google is your friend.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BFnnTyV7hbH09n_XOMk5N2Ta-ShTbzoZ-O3gHy9oQFpVy-3Wg%40mail.gmail.com.
On 19 Jan 2014 00:18, "François Schiettecatte" <fschiet...@gmail.com> wrote:
>
> Hi
>
> IANA says the JSON mime type be application/json, so you might want to use that.
>
> application/javascript should be for javascript.
Yes thats true. My bad.