background-image: url (with a URL that has parentheses with Django template

0

I have a div like this:

<div style='background-image: url({{ OBJETO.URL }})' class="video-thumb"></div>

Where Objeto.url delivers a string like this:

http://dominio/rota/id/original/(nome)8.jpg

When rendering the HTML, it gets invalid in this background-image because the second parentheses of this part (nome) closes the value of the backgroud-image url.

By the browser, inspecting and placing double quotation marks around it works.

So I tried to change the html to:

<div style='background-image: url("{{ OBJETO.URL }}")' class="video-thumb"></div>

But he ignored the quotes at that time.

I'd like to know how to make it look like (nome) as part of my URL.

    
asked by anonymous 11.12.2016 / 19:48

1 answer

4

Escape the parentheses using %28 ( ) and %29 ( ) ).

    
11.12.2016 / 20:27