mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #21221 -- Made form Media and static template tag use staticfiles if installed.
This commit is contained in:
parent
6be9589eb3
commit
cf546e11ac
34 changed files with 145 additions and 144 deletions
|
@ -68,13 +68,11 @@ Next, add the following at the top of ``polls/templates/polls/index.html``:
|
|||
.. snippet:: html+django
|
||||
:filename: polls/templates/polls/index.html
|
||||
|
||||
{% load staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}" />
|
||||
|
||||
``{% load staticfiles %}`` loads the :ttag:`{% static %} <staticfiles-static>`
|
||||
template tag from the ``staticfiles`` template library. The ``{% static %}``
|
||||
template tag generates the absolute URL of the static file.
|
||||
The ``{% static %}`` template tag generates the absolute URL of static files.
|
||||
|
||||
That's all you need to do for development. Reload
|
||||
``http://localhost:8000/polls/`` and you should see that the question links are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue