I tried to use CKEeditor for my django project, but when I add a new element that this editor uses, I see html code.
I used it as follows:
My model:
class Article(models.Model): title = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) category = models.ForeignKey('Category') content = RichTextField() date = models.DateTimeField(auto_now = True) online = models.BooleanField()
my url: url(r'^ckeditor/', include('ckeditor.urls')),
my opinion:
def view_post(request, slug): return render_to_response('website/view_post.html', { 'post': get_object_or_404(Article, slug=slug), }, context_instance = RequestContext(request) )
and my template:
<div id="post"> <h1> {{ post.title }}</h1> <p>{{post.content}}</p> <i>{{post.date}}</i> </div>
Please, help.
Thank you for your responses.
source share