Answer the question
In order to leave comments, you need to log in
Why after adding text using ckeditor, it is not displayed correctly?
Added ckeditor, it is displayed normally in the admin panel. Let's say I write an article for a blog, publish it and format it there. I save and view the article and it is displayed with html tags.
That is like this:
<address><strong>ssl on;</strong></address> <address><strong> ssl_stapling on;<br />
class Post(models.Model):
title = models.CharField(max_length=255, unique=True)
datetime = models.DateTimeField(u'Date')
anonse = RichTextField()
content = RichTextField()
slug = models.SlugField(verbose_name = u'URL',primary_key=True, max_length=250, unique=True)
category = models.ForeignKey(Category,verbose_name=u'Category')
def __str__(self):
return self.content
def get_absolute_url(self):
return '{}'.format(self.slug)
class PostDetail(DetailView):
model = Post
context_object_name = 'post'
slug_field = 'slug'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question