Fixed #25120 -- Deprecated egg template loader.

This commit is contained in:
Tim Graham 2015-07-16 09:32:42 -04:00
parent 8e306967de
commit 1fed8dd715
6 changed files with 12 additions and 1 deletions

View File

@ -208,7 +208,6 @@ TEMPLATE_DIRS = []
TEMPLATE_LOADERS = [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
]
# List of processors used by RequestContext to populate the context.

View File

@ -15,6 +15,8 @@ try:
except ImportError:
resource_string = None
warnings.warn('The egg template loader is deprecated.', RemovedInDjango20Warning)
class EggOrigin(Origin):

View File

@ -82,6 +82,8 @@ details on these changes.
* ``Field._get_val_from_obj()`` will be removed in favor of
``Field.value_from_object()``.
* ``django.template.loaders.eggs.Loader`` will be removed.
.. _deprecation-removed-in-1.10:
1.10

View File

@ -893,6 +893,10 @@ loaders that come with Django:
.. class:: eggs.Loader
.. deprecated:: 1.9
Distributing applications as eggs is not recommended.
Just like ``app_directories`` above, but it loads templates from Python
eggs rather than from the filesystem.

View File

@ -1004,6 +1004,9 @@ Miscellaneous
* ``django.db.models.Field._get_val_from_obj()`` is deprecated in favor of
``Field.value_from_object()``.
* ``django.template.loaders.eggs.Loader`` is deprecated as distributing
applications as eggs is not recommended.
.. removed-features-1.9:
Features removed in 1.9

View File

@ -153,6 +153,7 @@ class EggLoaderTests(SimpleTestCase):
del pkg_resources._provider_factories[MockLoader]
@classmethod
@ignore_warnings(category=RemovedInDjango20Warning)
def setUpClass(cls):
cls.engine = Engine(loaders=[
'django.template.loaders.eggs.Loader',