summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-01-17 15:58:19 -0500
committerTim Graham <timograham@gmail.com>2014-01-17 16:06:54 -0500
commit85149a8b7fb560960fb6e8b64e1d9f486e982c19 (patch)
tree216c64f8041e997a7796f432ca865b5ef627b2a2
parent4f058655d0defad179f1a92c7e2d1f282c26b1f0 (diff)
[1.6.x] Fixed #18942 -- Clarified usage of {% get_static_prefix %}.
Thanks Aymeric for the suggestion. Backport of bc7668eb51 from master
-rw-r--r--docs/ref/settings.txt6
-rw-r--r--docs/ref/templates/builtins.txt7
2 files changed, 5 insertions, 8 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 95104afacf..42f2038650 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2592,9 +2592,7 @@ tuples, e.g.::
("downloads", "/opt/webfiles/stats"),
)
-Example:
-
-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" %}">
.. setting:: STATICFILES_STORAGE
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 6e773f67c7..6d1ca6b42c 100644
--- a/docs/ref/templates/builtins.txt
+++ b/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
-instead::
+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!" />