mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #19879 -- Have 'findstatic' says on which directories it searched the relative paths.
Added searched_locations in finders module. Added verbosity flag level 2 on 'findstatic' command that will output the directories on which it searched the relative paths. Reported by ccurvey. Initial patch by Jonas Svensson and Vajrasky Kok.
This commit is contained in:
parent
935e6c1dfc
commit
6a9ed7d403
5 changed files with 100 additions and 3 deletions
|
@ -162,6 +162,23 @@ output and just get the path names::
|
|||
/home/special.polls.com/core/static/css/base.css
|
||||
/home/polls.com/core/static/css/base.css
|
||||
|
||||
On the other hand, by setting the :djadminopt:`--verbosity` flag to 2, you can
|
||||
get all the directories on which it searched the relative paths::
|
||||
|
||||
$ python manage.py findstatic css/base.css --verbosity 2
|
||||
Found 'css/base.css' here:
|
||||
/home/special.polls.com/core/static/css/base.css
|
||||
/home/polls.com/core/static/css/base.css
|
||||
Looking in the following locations:
|
||||
/home/special.polls.com/core/static
|
||||
/home/polls.com/core/static
|
||||
/some/other/path/static
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The additional message of on which directories it searched the relative
|
||||
paths is new in Django 1.7.
|
||||
|
||||
.. _staticfiles-runserver:
|
||||
|
||||
runserver
|
||||
|
@ -366,6 +383,23 @@ files:
|
|||
|
||||
.. _staticfiles-development-view:
|
||||
|
||||
Finders Module
|
||||
==============
|
||||
|
||||
``staticfiles`` finders has a ``searched_locations`` list with directory paths
|
||||
in which they search for the relative paths. Example usage::
|
||||
|
||||
from django.contrib.staticfiles import finders
|
||||
|
||||
result = finders.find('css/base.css')
|
||||
searched_locations = finders.searched_locations
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``get_searched_locations`` function is new in Django 1.7. Previously, we
|
||||
have to check the locations of our :setting:`STATICFILES_FINDERS` manually
|
||||
one by one.
|
||||
|
||||
Static file development view
|
||||
----------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue