Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[1.6.x] Fixed #18942 -- Clarified usage of {% get_static_prefix %}.

Thanks Aymeric for the suggestion.

Backport of bc7668e from master
  • Loading branch information...
commit 85149a8b7fb560960fb6e8b64e1d9f486e982c19 1 parent 4f05865
@timgraham timgraham authored
Showing with 5 additions and 8 deletions.
  1. +2 −4 docs/ref/settings.txt
  2. +3 −4 docs/ref/templates/builtins.txt
6 docs/ref/settings.txt
@@ -2592,9 +2592,7 @@ tuples, e.g.::
("downloads", "/opt/webfiles/stats"),
-Assuming you have :setting:`STATIC_URL` set ``'/static/'``, the
+For example, assuming you have :setting:`STATIC_URL` set to ``'/static/'``, the
:djadmin:`collectstatic` management command would collect the "stats" files
in a ``'downloads'`` subdirectory of :setting:`STATIC_ROOT`.
@@ -2604,7 +2602,7 @@ This would allow you to refer to the local file
.. code-block:: html+django
- <a href="{{ STATIC_URL }}downloads/polls_20101022.tar.gz">
+ <a href="{% static "downloads/polls_20101022.tar.gz" %}">
7 docs/ref/templates/builtins.txt
@@ -2456,10 +2456,9 @@ get_static_prefix
.. highlight:: html+django
-If you're not using :class:`~django.template.RequestContext`, or if you need
-more control over exactly where and how :setting:`STATIC_URL` is injected
-into the template, you can use the :ttag:`get_static_prefix` template tag
+You should prefer the :ttag:`static` template tag, but if you need more control
+over exactly where and how :setting:`STATIC_URL` is injected into the template,
+you can use the :ttag:`get_static_prefix` template tag::
{% load static %}
<img src="{% get_static_prefix %}images/hi.jpg" alt="Hi!" />

0 comments on commit 85149a8

Please sign in to comment.
Something went wrong with that request. Please try again.