diff options
| author | Vajrasky Kok <sky.kok@speaklikeaking.com> | 2013-11-16 22:55:50 +0800 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2014-02-09 14:22:22 +0000 |
| commit | 6a9ed7d403a5f90a7c7354097aae99b74e8ce215 (patch) | |
| tree | 195b7c8caf703ec0e792af2f2e99bb6286560e48 /docs/ref | |
| parent | 935e6c1dfc10808272bfda1bbda03bfee035f3dc (diff) | |
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.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/staticfiles.txt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index 74c6fe7e5b..214128e2cd 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -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 ---------------------------- |
