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:
Vajrasky Kok 2013-11-16 22:55:50 +08:00 committed by Jannis Leidel
parent 935e6c1dfc
commit 6a9ed7d403
5 changed files with 100 additions and 3 deletions

View file

@ -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
----------------------------