Hi. I'm not sure what exactly you are doing and how/where you are displaying this stuff. But it sounds like you are escaping the html, django does this by default to protect sites from XSS attacks ect. You can either stop the auto escaping in the template or use the |safe tag. You can read about django auto escaping in the docs at: http://docs.djangoproject.com/en/dev/topics/templates/#id2
~Jakob On 18 Mar., 16:32, Juan Hernandez <vladjani...@gmail.com> wrote: > 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 <em><strong>sdfsdfsd</strong></em> > > 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 django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---