Django-ckeditor无法在html中正确显示 [英] Django-ckeditor not displaying correctly in html

查看:216
本文介绍了Django-ckeditor无法在html中正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题,我在admin部分安装了Django-ckeditor。
我可以在Admin中完美使用它,但是当我在Html页面上显示时,它不能正确显示,我会放置一些图像以具有更好的视觉效果。

I have a little problem, I installed Django-ckeditor in my admin section. I can perfectly use it in Admin, but when I display on the Html page it is not showing correctly, I'll put some image to have a better visual.

这是我的管理员,非常好用!

Here is my admin ckeditor, works perfectly!

此处是我的html页面,ckeditor无法正常运行

Here is my html page, where the ckeditor don't works correctly

如何解决此问题? (我使用python 2.7.4和Django 1.7.4)

How Can I resolve this issue ? (I use python 2.7.4 and Django 1.7.4)

推荐答案

在模板中呈现html时,请确保将其标记为安全...

When rendering html in templates, make sure you mark it as safe...

{{ article.content|safe }}

请参阅文档:

https://docs.djangoproject.com/zh-CN/1.7/ref/templates/builtins/#safe

这篇关于Django-ckeditor无法在html中正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆