mirror of
https://github.com/django/django.git
synced 2025-07-22 18:49:25 +00:00
[2.0.x] Fixed #29265 -- Removed the suggestion to hardcode static URLs.
Backport of ba5f24ea6491780bb245ed6f0e5f015f4defffe9 from master
This commit is contained in:
parent
9fc5a1fa0c
commit
a3007ecf35
@ -18,12 +18,8 @@ Configuring static files
|
|||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
3. In your templates, either hardcode the url like
|
3. In your templates, use the :ttag:`static` template tag to build the URL for
|
||||||
``/static/my_app/example.jpg`` or, preferably, use the :ttag:`static`
|
the given relative path using the configured :setting:`STATICFILES_STORAGE`.
|
||||||
template tag to build the URL for the given relative path by using the
|
|
||||||
configured :setting:`STATICFILES_STORAGE` storage (this makes it much easier
|
|
||||||
when you want to switch to a content delivery network (CDN) for serving
|
|
||||||
static files).
|
|
||||||
|
|
||||||
.. _staticfiles-in-templates:
|
.. _staticfiles-in-templates:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user