Finally solved my Django unicode error

I had an annoying problem in my Django app when I translated it to Hebrew, & started adding Hebrew data. It would yell the regular ‘ascii can’t decode non-ascii characters’ error page. I dug a bit inside the admin code but didn’t see something wrong or fixable.

So today I finally understood I need to change the __str__ method to __unicode__ . This solved the problem completely. Too bad it doesn’t appear in the Django documentation nowhere. I would expect it in the Internationalization page & the tutorials too!

4 thoughts on “Finally solved my Django unicode error

  1. Thanks for answering Jacob!
    I expect it to be in any page returned by Google in queries for Django + any of the terms in this error. Perhaps you can put some kind of knowledge-base for common errors.

    Searching for it now, I see the Unicode page & also that the Tutorial now mentions it, which I hope will be helpful for ppl encountering this.

    It just wasted me so much time, I had to put it online for their sake.

    Thanks BTW for your beautiful & empowering framework!

  2. Thank you dibau,
    I did come across it when I had gone through either the djangobook (I can’t help thinking about this name as a tribute to Rudyiard Kipling) or the djangoproject documentation, but you were quite clear about the subject.
    Cheers
    My thanks also to Jacob Kaplan-Moss (Jacob, the link you provided is dead).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s