Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
29345390
Kaydet (Commit)
29345390
authored
Şub 09, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor edits to new findstatic functionality; refs #19879.
Hopefully fixes a test failure on Jenkins.
üst
e2f28572
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
28 deletions
+25
-28
staticfiles.txt
docs/ref/contrib/staticfiles.txt
+17
-20
1.7.txt
docs/releases/1.7.txt
+4
-4
tests.py
tests/staticfiles_tests/tests.py
+4
-4
No files found.
docs/ref/contrib/staticfiles.txt
Dosyayı görüntüle @
29345390
...
...
@@ -163,7 +163,7 @@ output and just get the path names::
/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
::
get all the directories
which were searched
::
$ python manage.py findstatic css/base.css --verbosity 2
Found 'css/base.css' here:
...
...
@@ -176,8 +176,7 @@ get all the directories on which it searched the relative paths::
.. versionadded:: 1.7
The additional message of on which directories it searched the relative
paths is new in Django 1.7.
The additional output of which directories were searched was added.
.. _staticfiles-runserver:
...
...
@@ -360,6 +359,21 @@ slightly different call:
{% static "images/hi.jpg" as myphoto %}
<img src="{{ myphoto }}" alt="Hi!" />
Finders Module
==============
``staticfiles`` finders has a ``searched_locations`` attribute which is a list
of directory paths in which the finders searched. Example usage::
from django.contrib.staticfiles import finders
result = finders.find('css/base.css')
searched_locations = finders.searched_locations
.. versionadded:: 1.7
The ``searched_locations`` attribute was added.
Other Helpers
=============
...
...
@@ -383,23 +397,6 @@ 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
----------------------------
...
...
docs/releases/1.7.txt
Dosyayı görüntüle @
29345390
...
...
@@ -390,6 +390,10 @@ Minor features
See the :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`
docs for more information.
* :djadmin:`findstatic` now accepts verbosity flag level 2, meaning it will
show the relative paths of the directories it searched. See
:djadmin:`findstatic` for example output.
:mod:`django.contrib.syndication`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
@@ -1051,10 +1055,6 @@ Miscellaneous
which does allow primary keys with value 0. It only forbids *autoincrement*
primary keys with value 0.
* :djadmin:`findstatic` now accepts verbosity flag level 2, meaning it will
show the directories on which it searched the relative paths. See
:djadmin:`findstatic` for example output.
.. _deprecated-features-1.7:
Features deprecated in 1.7
...
...
tests/staticfiles_tests/tests.py
Dosyayı görüntüle @
29345390
...
...
@@ -236,19 +236,19 @@ class TestFindStatic(CollectionTestCase, TestDefaults):
self
.
assertIn
(
'apps'
,
force_text
(
lines
[
2
]))
self
.
assertIn
(
"Looking in the following locations:"
,
force_text
(
lines
[
3
]))
searched_locations
=
', '
.
join
(
lines
[
4
:])
#AppDirectoriesFinder searched locations
#
AppDirectoriesFinder searched locations
self
.
assertIn
(
os
.
path
.
join
(
'staticfiles_tests'
,
'apps'
,
'test'
,
'static'
),
searched_locations
)
self
.
assertIn
(
os
.
path
.
join
(
'staticfiles_tests'
,
'apps'
,
'no_label'
,
'static'
),
searched_locations
)
self
.
assertIn
(
os
.
path
.
join
(
'django'
,
'contrib'
,
'admin'
,
'static'
),
searched_locations
)
self
.
assertIn
(
os
.
path
.
join
(
'
django'
,
'
tests'
,
'servers'
,
'another_app'
,
'static'
),
self
.
assertIn
(
os
.
path
.
join
(
'tests'
,
'servers'
,
'another_app'
,
'static'
),
searched_locations
)
#FileSystemFinder searched locations
#
FileSystemFinder searched locations
self
.
assertIn
(
TEST_SETTINGS
[
'STATICFILES_DIRS'
][
1
][
1
],
searched_locations
)
self
.
assertIn
(
TEST_SETTINGS
[
'STATICFILES_DIRS'
][
0
],
searched_locations
)
#DefaultStorageFinder searched locations
#
DefaultStorageFinder searched locations
self
.
assertIn
(
os
.
path
.
join
(
'staticfiles_tests'
,
'project'
,
'site_media'
,
'media'
),
searched_locations
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment