1

The following template renders with the image from the static directory appearing, but myvar doesn't show up. Somehow {{STATIC_URL}} is being evaluated correctly, but {{myvar}} is empty. What am I missing?

views.py

def home(request):
    return render_to_response('home/home.html', 
        {
        'myvar':"something",
        },
        context_instance=RequestContext(request,{}))

home.html

<html>
<h1>{{myvar}}</h1>

<img src="{{STATIC_URL}}home/Marcy.jpg">
</html>
Paolo
  • 20,112
  • 21
  • 72
  • 113
Isaac Ray
  • 1,351
  • 9
  • 17

2 Answers2

0

On official documentation of Django 1.7, on render_to_response method, the example uses context_instance=RequestContext(request). So, if you take it off the dict of RequestContext, maybe this works.

hermancaldara
  • 451
  • 1
  • 6
  • 13
0

Was missing something obvious: Error was being thrown when restarting gunicorn. Once fixed, problem went away.

Isaac Ray
  • 1,351
  • 9
  • 17