Z
Z
zelsky2015-05-13 17:13:39
Django
zelsky, 2015-05-13 17:13:39

ckeditor django display?

Why do I see the html code in the template after getting the text formatted in ckeditor from the database?

<div class="page-header">
 <h3> Тактико технічні характеристики</h3>
</div> {{ details.tth }} 

<div class="page-header">
 <h3> Технічне обслуговування</h3>
</div> {{ details.teh_obslug }}

def detali(request,id_ekz):
    details = Stats.objects.get(pk=id_ekz)
    rozdil = Rozdil.objects.all()
    context = {'details':details,'rozdil': rozdil}

    return render(request,'details.html',context)

url(r'^detali/(?P<id_ekz>\d+)', 'wiki.views.detali'),

50084eeec02b415c8d13dbe57b3287c2.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zelsky, 2015-05-13
@zelsky

In the display, add | safe and everything will be ok. Thank you all, let's go.
Zagalna Budova
{{ details.zag_bund | safe))

E
Evgeny Maltsev, 2015-05-13
@hellpirat

{% autoescape off %} {{ details.tth }} {% endautoescape %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question