How to put html links/tags in models.Textfield

Asked

Viewed 132 times

0

Everybody, all with you?

I have a Description field and it is a Textfield, how do I format a link in it ? (make it cute) I tried to put html tags but it n accepts.

py.models:

description = models.TextField()

In Django admin: inserir a descrição da imagem aqui

In the rendered template:

inserir a descrição da imagem aqui

I wanted the cute link to appear but it n recognizes the tag

  • I don’t think you understand the question.

  • Have you tried with safe in rendering? something like {{conteudo|safe}} ?

  • Oops, I had to see the filters one by one and I found the safe, thank you

1 answer

0


You need to tell Jango that this HTML is "reliable" for this:

{{ seu_model.Description | safe }} That Django will render.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.