Lucas Noah
Lucas Noah

Reputation: 389

serving dynamically generated static img file in template django 1.6 dev server

I am trying to serve a static img file in a template that I have just had Django generate. The template code looks like this.

<img src="{% static {{ output }} %}" height="50px" width="50px" alt="hi">

output is a context variable that I passed to the template through my views. When I try and load the page I get this error.

Exception Type: TemplateSyntaxError Exception Value: Could not parse the remainder: '{{' from '{{'

obviously my syntax for passing a context variable to the static file method is flawed. I am using the DJango 1.6 dev server and all of my other static files are working. Does anyone know the correct syntax for this?

Upvotes: 0

Views: 220

Answers (1)

meteorainer
meteorainer

Reputation: 952

You dont need {{}} inside {% %}

Upvotes: 3

Related Questions