hello Django users
I am a beginner using Django from the trunk and Postgres 8.2

I have this issue with utf8, you can replicate it this way (it is
something similiar to this with MySql i guess:
http://groups.google.com/group/django-users/browse_frm/thread/d7dd21493ab5f1fa/a0bd99e381d9de2a?tvc=1&q=encoding+admin#a0bd99e381d9de2a)

1) create a postgres db like this:

CREATE DATABASE test2
  WITH ENCODING='UTF8'
       OWNER=test;

2) create a django project

django-admin.py startproject testutf

3) configure the settings.py file for the database access and enable
the admin application

4) create a test application

python manage.py startapp apptestutf

5) create this simple model

from django.db import models

class Person(models.Model):
        name = models.CharField('name', max_length=100)

        def __str__(self):
                return '%s' % self.name

6) sync db

 python manage.py syncdb

7) run the shell and add this object

 python manage.py shell

>>> from testutf.apptestutf.models import Person
>>> Person.objects.create(name=u'Paol\xe8')
<Person: Paolè>

8) start the server

 python manage.py runserver

If I access the object I just created from the admin interface:

http://localhost:8000/admin/apptestutf/person/6/

I get this error:

TemplateSyntaxError at /admin/apptestutf/person/6/

Caught an exception while rendering: 'ascii' codec can't encode
character u'\xe8' in position 4: ordinal not in range(128)

Any ideas? Thanks in advance

Paolo Corti

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to