Skip to content Skip to sidebar Skip to footer

Manage.py Syncdb Error While Django Model Using Non-ascii Verbose_name

I am pretty new to Django. I want the name of my models to be displayed in Chinese, so i used verbose_name in my meta class of my model, codes below: #this models.py file is encode

Solution 1:

You have to specify an encoding. Add the following line as the first line of your models.py file.

# encoding: utf-8

Update

The OP has edited his question to say that the "models.py is encoded in Unicode". Then the error is strange. It works for me using Django 1.2.1, Python 2.6.2 on Ubuntu Jaunty.

Update 2

Can you post the encoding string you have used for your models.py?

Post a Comment for "Manage.py Syncdb Error While Django Model Using Non-ascii Verbose_name"