To learn limodou step by step, complete an address book based on the example in Chapter 7. OS: Debian etch locale: zh_CN.UTF-8 Django 1.0 python2.4.4 address/models. the py content is as follows # Coding = UTF-8 2 3 from Django. DB import models 4 5 # create your models here. 6 7 Class address (models. model): 8 name = models. charfield ('name', max_length = 20, unique = true) 9 Gender = models. charfield ('gender ', choices = ('M', 'male'), ('F', 'female'), 10 max_length = 1) 11 telephone = models. charfield ('telephony ', max_length = 20) 12 mobile = mod Els. charfield ('cell phone ', max_length = 11) 13 14 15 class admin: 16 pass on the admin page, you can add and save the address object. Click address object, the record content can be correctly displayed. Add def _ STR _ (Self): return self. the name of the address object is displayed in the admin interface, but the following error occurs when you click the name to display the content: templatesyntaxerror at/admin/address/1/caught an exception while rendering: 'ascii 'codec can't encode characters in position 0-2: ordinal not in range (128) original traceback (most recent call last): file "/usr/lib/python2.4/Site-packages/Django/template/debug. PY ", line 71, in render_node result = node. render (context) file "/usr/lib/python2.4/Site-packages/Django/template/debug. PY ", line 87, in render output = force_unicode (self. filter_expression.resolve (context) file "/usr/lib/python2.4/Site-packages/Django/template/_ init __. PY ", line 559, in resolve new_obj = func (OBJ, * arg_vals) file"/usr/lib/python2.4/Site-packages/Django/template/defaultfilters. PY ", line 31, in _ dec ARGs [0] = force_unicode (ARGs [0]) file"/usr/lib/python2.4/Site-packages/Django/utils/encoding. PY ", line 52, in force_unicode S = Unicode (STR (s), encoding, errors) unicodeencodeerror: 'ascii 'codec can't encode characters in position 0-2: ordinal not in range (128) solution: __str _ () changed to _ Unicode _ () After Django was upgraded to 1.0, there were some changes, the class admin is no longer used to generate management interfaces.