summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Timmons <prestontimmons@gmail.com>2015-01-05 14:43:15 -0600
committerTim Graham <timograham@gmail.com>2015-01-05 19:35:02 -0500
commitde9ebdd39cb4f4b65475b43e0e32772d5a315654 (patch)
treea1829e7865df451879a52f3dfda2affc18453809
parenta9aec1154e5b65fcaf608801905a1bbafcfbfbf7 (diff)
Fixed #24022 -- Deprecated the ssi tag.
-rw-r--r--django/template/defaulttags.py5
-rw-r--r--docs/internals/deprecation.txt2
-rw-r--r--docs/ref/settings.txt10
-rw-r--r--docs/ref/templates/builtins.txt7
-rw-r--r--docs/releases/1.8.txt8
-rw-r--r--tests/template_tests/syntax_tests/test_ssi.py3
-rw-r--r--tests/template_tests/tests.py4
7 files changed, 33 insertions, 6 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index edd8260aad..7085e04cdb 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -1088,6 +1088,11 @@ def ssi(parser, token):
{% 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()
parsed = False
if len(bits) not in (2, 3):
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 14422c3cc8..b74f550ba8 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -125,6 +125,8 @@ details on these changes.
* The ``--list`` option of the ``migrate`` management command will be removed.
+* The ``ssi`` template tag will be removed.
+
.. _deprecation-removed-in-1.9:
1.9
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 3769695820..8d0d17c010 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -125,8 +125,14 @@ Default: ``()`` (Empty tuple)
.. deprecated:: 1.8
- Set the ``'allowed_include_roots'`` option in the :setting:`OPTIONS
- <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend instead.
+ This setting, along with the :ttag:`ssi` template tag, is deprecated and
+ 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
tag. This is a security measure, so that template authors can't access files
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index dced4cdee6..b9d2afb603 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -705,8 +705,6 @@ available to the included template::
been evaluated and rendered* - not blocks that can be overridden by, for
example, an extending template.
-See also: :ttag:`{% ssi %}<ssi>`.
-
.. templatetag:: load
load
@@ -979,6 +977,11 @@ this example, the space around ``Hello`` won't be stripped::
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.
Like a simple :ttag:`include` tag, ``{% ssi %}`` includes the contents of
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 7e7b93ec0f..cdb25c4c30 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -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
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:
Features removed in 1.8
diff --git a/tests/template_tests/syntax_tests/test_ssi.py b/tests/template_tests/syntax_tests/test_ssi.py
index bc70aca9c6..b87c1f9c2c 100644
--- a/tests/template_tests/syntax_tests/test_ssi.py
+++ b/tests/template_tests/syntax_tests/test_ssi.py
@@ -1,11 +1,12 @@
import os
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
+@ignore_warnings(category=RemovedInDjango20Warning)
class SsiTagTests(SimpleTestCase):
# Test normal behavior
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 6712ad12b1..b404a83098 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -13,7 +13,8 @@ from django.template import (base as template_base, loader,
from django.template.engine import Engine
from django.template.loaders import app_directories, filesystem
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
@@ -501,6 +502,7 @@ class RequestContextTests(unittest.TestCase):
RequestContext(request, dict_=test_data, engine=engine))
+@ignore_warnings(category=RemovedInDjango20Warning)
class SSITests(SimpleTestCase):
def setUp(self):
self.this_dir = os.path.dirname(os.path.abspath(upath(__file__)))