Hi there,

This has been killing me for hours and I don't know what else to do. Is
about the famous charset in django.

I have this model:

class Post(models.Model):
    user = models.ForeignKey(User)
    category = models.ForeignKey(Categories)
    title = models.CharField(max_length=50)
    post = models.CharField(max_length=10000)
    date = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return u%s %s %s %s %s(self.user, self.category, self.title,
self.post, self.date)

with this information on the database:

mysql> select * from blog_post;
+----+---------+-------------+------------------+--------------------------------------------
+---------------------+
| id | user_id | category_id | title            |
post                                                                  |
date                |
+----+---------+-------------+------------------+--------------------------------------------
+---------------------+
|  8 |       1 |           2 | html <i>Aqui</i> | asdfasd
<em><strong>sdfsdfsd</strong></em> | 2009-03-18 01:27:49 |
+----+---------+-------------+------------------+--------------------------------------------
+---------------------+
8 rows in set (0.00 sec)

and the post column is being rendered on django html like this:

asdfasd &lt;em&gt;&lt;strong&gt;sdfsdfsd&lt;/strong&gt;&lt;/em&gt;

What is going on? I have changed the CHARACTER_SET in settings.py and
followed many things on different threats with no success at all

Everything on the DB is utf8 and I also have DEFAULT_CHARSET = 'utf8' at
settings.py

How can I have django display html code from the databse without any
problems?

Thanks a lot
Juan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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