0👍
Anyway , when i see json
in the chrome +33 , response does not show utf8
word but when i see response in the Firefox every thing is Ok , and when i parse the Json
every thing is Ok .
1👍
The problem is with self.title.encode('utf8')
. Seems like your are using python 2. The encode()
function converts string to bytes. That’s why title is getting weird. Since you are already importing unicode_literals
from __future__
, all the string will be unicode. Just return self.title
that would solve the problem.. For more info https://docs.python.org/2/howto/unicode.html
- [Answered ]-How to setup Django PyDev project with virtualenv created with pyenv
- [Answered ]-Django – Use signals to refresh another model's fields
- [Answered ]-Django Ajax Request still results to CSRF Token Missing or Incorrect
- [Answered ]-Django : ManyToMany relation error ( object has no attribute)
- [Answered ]-Django models can't migrate
1👍
Ensure that u assign correct encoding to http header so browser will recognize encoding of data.
Example below show how u can identify it using Developer Tool in Firefox. Same tools exists in Chrome . If u clearly will not assign encoding in header then browser will try guest or use default to encode data from server.
- [Answered ]-Django – Concatenated CreateView, autofill hidden input
- [Answered ]-Invalid literal for int() error in ForeignKey default
- [Answered ]-How to make a string visible on a webpage using Django form fields