mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Fixed #24022 -- Deprecated the ssi tag.
This commit is contained in:
parent
a9aec1154e
commit
de9ebdd39c
@ -1088,6 +1088,11 @@ def ssi(parser, token):
|
|||||||
|
|
||||||
{% ssi "/home/html/ljworld.com/includes/right_generic.html" parsed %}
|
{% ssi "/home/html/ljworld.com/includes/right_generic.html" parsed %}
|
||||||
"""
|
"""
|
||||||
|
warnings.warn(
|
||||||
|
"The {% ssi %} tag is deprecated. Use the {% include %} tag instead.",
|
||||||
|
RemovedInDjango20Warning,
|
||||||
|
)
|
||||||
|
|
||||||
bits = token.split_contents()
|
bits = token.split_contents()
|
||||||
parsed = False
|
parsed = False
|
||||||
if len(bits) not in (2, 3):
|
if len(bits) not in (2, 3):
|
||||||
|
@ -125,6 +125,8 @@ details on these changes.
|
|||||||
|
|
||||||
* The ``--list`` option of the ``migrate`` management command will be removed.
|
* The ``--list`` option of the ``migrate`` management command will be removed.
|
||||||
|
|
||||||
|
* The ``ssi`` template tag will be removed.
|
||||||
|
|
||||||
.. _deprecation-removed-in-1.9:
|
.. _deprecation-removed-in-1.9:
|
||||||
|
|
||||||
1.9
|
1.9
|
||||||
|
@ -125,8 +125,14 @@ Default: ``()`` (Empty tuple)
|
|||||||
|
|
||||||
.. deprecated:: 1.8
|
.. deprecated:: 1.8
|
||||||
|
|
||||||
Set the ``'allowed_include_roots'`` option in the :setting:`OPTIONS
|
This setting, along with the :ttag:`ssi` template tag, is deprecated and
|
||||||
<TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend instead.
|
will be removed in Django 2.0.
|
||||||
|
|
||||||
|
.. versionchanged:: 1.8
|
||||||
|
|
||||||
|
You can also set the ``'allowed_include_roots'`` option in the
|
||||||
|
:setting:`OPTIONS <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend
|
||||||
|
instead.
|
||||||
|
|
||||||
A tuple of strings representing allowed prefixes for the ``{% ssi %}`` template
|
A tuple of strings representing allowed prefixes for the ``{% ssi %}`` template
|
||||||
tag. This is a security measure, so that template authors can't access files
|
tag. This is a security measure, so that template authors can't access files
|
||||||
|
@ -705,8 +705,6 @@ available to the included template::
|
|||||||
been evaluated and rendered* - not blocks that can be overridden by, for
|
been evaluated and rendered* - not blocks that can be overridden by, for
|
||||||
example, an extending template.
|
example, an extending template.
|
||||||
|
|
||||||
See also: :ttag:`{% ssi %}<ssi>`.
|
|
||||||
|
|
||||||
.. templatetag:: load
|
.. templatetag:: load
|
||||||
|
|
||||||
load
|
load
|
||||||
@ -979,6 +977,11 @@ this example, the space around ``Hello`` won't be stripped::
|
|||||||
ssi
|
ssi
|
||||||
^^^
|
^^^
|
||||||
|
|
||||||
|
.. deprecated:: 1.8
|
||||||
|
|
||||||
|
This tag has been deprecated and will be removed in Django 2.0. Use the
|
||||||
|
:ttag:`include` tag instead.
|
||||||
|
|
||||||
Outputs the contents of a given file into the page.
|
Outputs the contents of a given file into the page.
|
||||||
|
|
||||||
Like a simple :ttag:`include` tag, ``{% ssi %}`` includes the contents of
|
Like a simple :ttag:`include` tag, ``{% ssi %}`` includes the contents of
|
||||||
|
@ -1385,6 +1385,14 @@ of ``Field.rel``. The latter is an instance of
|
|||||||
module has been removed and the ``Field.related`` attribute will be removed in
|
module has been removed and the ``Field.related`` attribute will be removed in
|
||||||
Django 2.0.
|
Django 2.0.
|
||||||
|
|
||||||
|
``ssi`` template tag
|
||||||
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
The :ttag:`ssi` template tag allows files to be included in a template by
|
||||||
|
absolute path. This is of limited use in most deployment situations, and
|
||||||
|
the :ttag:`include` tag often makes more sense. This tag is now deprecated and
|
||||||
|
will be removed in Django 2.0.
|
||||||
|
|
||||||
.. removed-features-1.8:
|
.. removed-features-1.8:
|
||||||
|
|
||||||
Features removed in 1.8
|
Features removed in 1.8
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from django.test import ignore_warnings, SimpleTestCase
|
from django.test import ignore_warnings, SimpleTestCase
|
||||||
from django.utils.deprecation import RemovedInDjango19Warning
|
from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
|
||||||
|
|
||||||
from ..utils import ROOT, setup
|
from ..utils import ROOT, setup
|
||||||
|
|
||||||
|
|
||||||
|
@ignore_warnings(category=RemovedInDjango20Warning)
|
||||||
class SsiTagTests(SimpleTestCase):
|
class SsiTagTests(SimpleTestCase):
|
||||||
|
|
||||||
# Test normal behavior
|
# Test normal behavior
|
||||||
|
@ -13,7 +13,8 @@ from django.template import (base as template_base, loader,
|
|||||||
from django.template.engine import Engine
|
from django.template.engine import Engine
|
||||||
from django.template.loaders import app_directories, filesystem
|
from django.template.loaders import app_directories, filesystem
|
||||||
from django.test import RequestFactory, SimpleTestCase
|
from django.test import RequestFactory, SimpleTestCase
|
||||||
from django.test.utils import override_settings, extend_sys_path
|
from django.test.utils import extend_sys_path, ignore_warnings, override_settings
|
||||||
|
from django.utils.deprecation import RemovedInDjango20Warning
|
||||||
from django.utils._os import upath
|
from django.utils._os import upath
|
||||||
|
|
||||||
|
|
||||||
@ -501,6 +502,7 @@ class RequestContextTests(unittest.TestCase):
|
|||||||
RequestContext(request, dict_=test_data, engine=engine))
|
RequestContext(request, dict_=test_data, engine=engine))
|
||||||
|
|
||||||
|
|
||||||
|
@ignore_warnings(category=RemovedInDjango20Warning)
|
||||||
class SSITests(SimpleTestCase):
|
class SSITests(SimpleTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.this_dir = os.path.dirname(os.path.abspath(upath(__file__)))
|
self.this_dir = os.path.dirname(os.path.abspath(upath(__file__)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user