Search code examples
djangodjango-templatesdjango-context

Django template doesn't seem to be getting my context dictionary


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>

Solution

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