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
5bc5ddd8
Kaydet (Commit)
5bc5ddd8
authored
Şub 03, 2015
tarafından
Preston Timmons
Kaydeden (comit)
Tim Graham
Şub 04, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #24235 -- Removed is_usable attribute from template loaders.
üst
7d363ed4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
29 deletions
+25
-29
engine.py
django/template/engine.py
+1
-12
app_directories.py
django/template/loaders/app_directories.py
+0
-1
base.py
django/template/loaders/base.py
+0
-1
cached.py
django/template/loaders/cached.py
+0
-1
eggs.py
django/template/loaders/eggs.py
+14
-11
filesystem.py
django/template/loaders/filesystem.py
+0
-2
locmem.py
django/template/loaders/locmem.py
+0
-1
1.9.txt
docs/releases/1.9.txt
+10
-0
No files found.
django/template/engine.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -121,18 +121,7 @@ class Engine(object):
"instead of django.template.loaders.base.Loader. "
%
loader
,
RemovedInDjango20Warning
,
stacklevel
=
2
)
loader_instance
=
loader_class
(
*
args
)
if
not
loader_instance
.
is_usable
:
warnings
.
warn
(
"Your template loaders configuration includes
%
r, but "
"your Python installation doesn't support that type of "
"template loading. Consider removing that line from "
"your settings."
%
loader
)
return
None
else
:
return
loader_instance
return
loader_class
(
*
args
)
else
:
raise
ImproperlyConfigured
(
"Invalid value in template loaders configuration:
%
r"
%
loader
)
...
...
django/template/loaders/app_directories.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -14,7 +14,6 @@ from .base import Loader as BaseLoader
class
Loader
(
BaseLoader
):
is_usable
=
True
def
get_template_sources
(
self
,
template_name
,
template_dirs
=
None
):
"""
...
...
django/template/loaders/base.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -2,7 +2,6 @@ from django.template.base import Template, TemplateDoesNotExist
class
Loader
(
object
):
is_usable
=
False
# Only used to raise a deprecation warning. Remove in Django 2.0.
_accepts_engine_in_init
=
True
...
...
django/template/loaders/cached.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -11,7 +11,6 @@ from .base import Loader as BaseLoader
class
Loader
(
BaseLoader
):
is_usable
=
True
def
__init__
(
self
,
engine
,
loaders
):
self
.
template_cache
=
{}
...
...
django/template/loaders/eggs.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -14,7 +14,11 @@ from .base import Loader as BaseLoader
class
Loader
(
BaseLoader
):
is_usable
=
resource_string
is
not
None
def
__init__
(
self
,
engine
):
if
resource_string
is
None
:
raise
RuntimeError
(
"Setuptools must be installed to use the egg loader"
)
super
(
Loader
,
self
)
.
__init__
(
engine
)
def
load_template_source
(
self
,
template_name
,
template_dirs
=
None
):
"""
...
...
@@ -22,14 +26,13 @@ class Loader(BaseLoader):
For every installed app, it tries to get the resource (app, template_name).
"""
if
resource_string
is
not
None
:
pkg_name
=
'templates/'
+
template_name
for
app_config
in
apps
.
get_app_configs
():
try
:
resource
=
resource_string
(
app_config
.
name
,
pkg_name
)
except
Exception
:
continue
if
six
.
PY2
:
resource
=
resource
.
decode
(
self
.
engine
.
file_charset
)
return
(
resource
,
'egg:
%
s:
%
s'
%
(
app_config
.
name
,
pkg_name
))
pkg_name
=
'templates/'
+
template_name
for
app_config
in
apps
.
get_app_configs
():
try
:
resource
=
resource_string
(
app_config
.
name
,
pkg_name
)
except
Exception
:
continue
if
six
.
PY2
:
resource
=
resource
.
decode
(
self
.
engine
.
file_charset
)
return
(
resource
,
'egg:
%
s:
%
s'
%
(
app_config
.
name
,
pkg_name
))
raise
TemplateDoesNotExist
(
template_name
)
django/template/loaders/filesystem.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -12,7 +12,6 @@ from .base import Loader as BaseLoader
class
Loader
(
BaseLoader
):
is_usable
=
True
def
get_template_sources
(
self
,
template_name
,
template_dirs
=
None
):
"""
...
...
@@ -44,4 +43,3 @@ class Loader(BaseLoader):
error_msg
=
(
"Your template directories configuration is empty. "
"Change it to point to at least one template directory."
)
raise
TemplateDoesNotExist
(
error_msg
)
load_template_source
.
is_usable
=
True
django/template/loaders/locmem.py
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -8,7 +8,6 @@ from .base import Loader as BaseLoader
class
Loader
(
BaseLoader
):
is_usable
=
True
def
__init__
(
self
,
engine
,
templates_dict
):
self
.
templates_dict
=
templates_dict
...
...
docs/releases/1.9.txt
Dosyayı görüntüle @
5bc5ddd8
...
...
@@ -182,6 +182,16 @@ Default settings that were tuples are now lists
The default settings in ``django.conf.global_settings`` were a combination of
lists and tuples. All settings that were formerly tuples are now lists.
``is_usable`` attribute on template loaders is removed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Django template loaders previously required an ``is_usable`` attribute to be
defined. If a loader was configured in the template settings and this attribute
was ``False``, the loader would be silently ignored. In practice, this was only
used by the egg loader to detect if setuptools was installed. The ``is_usable``
attribute is now removed and the egg loader instead fails at runtime if
setuptools is not installed.
Miscellaneous
~~~~~~~~~~~~~
...
...
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