Django: Can't render STATIC_URL from settings in template

This suggests that I can use STATIC_URL in my template to get the value from

Template looks like this:

<link href="{{STATIC_URL}}stylesheets/tabs.css" rel="stylesheet" type="text/css"  media="screen" /> looks like this:

STATIC_URL = '/static/'

When I go to the page I just get <link href="stylesheets/tabs.css" i.e. no STATIC_URL.

What am I missing?


You have to use context_instance=RequestContext(request) in your render_to_response, for example:

return render_to_response('my_template.html',

Or use the new shortcut render

As Dave pointed out, you should check if django.core.context_processors.static is in your TEMPLATE_CONTEXT_PROCESSORS variable in As the docs said, it`s there by default.

It is not recommended to directly use the STATIC_URL variable. See the accepted answer in this question

Instead of



{% load staticfiles %}
{% static 'stylesheets/tabs.css' %}

Need Your Help

How do you un-deploy Cloud Functions for Firebase?

firebase google-cloud-functions

I was experimenting with Cloud Functions for Firebase and deployed one of the samples in the functions-samples repo and linked it to an existing project using firebase use --add.