Is it possible to display an image from a TextField () field? [double]

this question already has an answer here : How to add Tinymce to a template? (1 answers) Closed 4 years ago .

Can I display images by inserting the link into a TextField () field??

The link to the image if it works but when I insert it into the body of the post (variable text = models.TextField()) appears to me as text only. Is it that with TextField () this cannot be accomplished or that the fault is somewhere else?

post image on Django

In case it is not possible if they can orient as can make.

 0
Author: Shaz, 2016-08-03

1 answers

With the Textfield () field if an image can be added by inserting the corresponding HTML code <img src="enlace" />

But when doing this you must add the filter safe to the template code. example:

{{ var|safe / escape}}

As indicated here in the documentation. Otherwise Django escapes for safety.

 0
Author: Cristianjs19, 2016-08-03 19:21:48