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

0

Can I show images by inserting the link in a TextField () field ??

The link to the image does work but when I insert it in the body of the post (variable text = models.TextField () ) it appears as text only. Can not this be done with TextField () or can it be found elsewhere?

If it is not possible, if they can guide how it can be done.

    
asked by Cristianjs19 03.08.2016 в 17:25
source

1 answer

0

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

but when you do this you must add the safe filter to the template code. example:

  

{{var | safe | escape}}

as here indicated in the documentation . Otherwise Django escapes for security.

    
answered by 03.08.2016 в 21:21