7
7
:ref:`deprecation policy <internal-release-deprecation-policy>`. More details
8
8
about each item can often be found in the release notes of two versions prior.
13
See the :doc:`Django 1.3 release notes</releases/1.3>` for more details on
16
* Starting Django without a :setting:`SECRET_KEY` will result in an exception
17
rather than a ``DeprecationWarning``. (This is accelerated from the usual
18
deprecation path; see the :doc:`Django 1.4 release notes</releases/1.4>`.)
20
* The ``mod_python`` request handler will be removed. The ``mod_wsgi``
21
handler should be used instead.
23
* The ``template`` attribute on :class:`~django.test.client.Response`
24
objects returned by the :ref:`test client <test-client>` will be removed.
25
The :attr:`~django.test.client.Response.templates` attribute should be
28
* The ``django.test.simple.DjangoTestRunner`` will be removed.
29
Instead use a unittest-native class. The features of the
30
``django.test.simple.DjangoTestRunner`` (including fail-fast and
31
Ctrl-C test termination) can currently be provided by the unittest-native
32
:class:`~unittest.TextTestRunner`.
34
* The undocumented function
35
``django.contrib.formtools.utils.security_hash`` will be removed,
36
instead use ``django.contrib.formtools.utils.form_hmac``
38
* The function-based generic view modules will be removed in favor of their
39
class-based equivalents, outlined :doc:`here
40
</topics/class-based-views/index>`.
42
* The ``django.core.servers.basehttp.AdminMediaHandler`` will be
43
removed. In its place use
44
``django.contrib.staticfiles.handlers.StaticFilesHandler``.
46
* The template tags library ``adminmedia`` and the template tag ``{%
47
admin_media_prefix %}`` will be removed in favor of the generic static files
48
handling. (This is faster than the usual deprecation path; see the
49
:doc:`Django 1.4 release notes</releases/1.4>`.)
51
* The :ttag:`url` and :ttag:`ssi` template tags will be
52
modified so that the first argument to each tag is a template variable, not
53
an implied string. In 1.4, this behavior is provided by a version of the tag
54
in the ``future`` template tag library.
56
* The ``reset`` and ``sqlreset`` management commands will be removed.
58
* Authentication backends will need to support an inactive user
59
being passed to all methods dealing with permissions.
60
The ``supports_inactive_user`` attribute will no longer be checked
61
and can be removed from custom backends.
63
* :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise
64
a :class:`~django.contrib.gis.geos.GEOSException` when called
65
on a geometry with no SRID value.
67
* ``django.http.CompatCookie`` will be removed in favor of
68
``django.http.SimpleCookie``.
70
* ``django.core.context_processors.PermWrapper`` and
71
``django.core.context_processors.PermLookupDict`` will be removed in
72
favor of the corresponding
73
``django.contrib.auth.context_processors.PermWrapper`` and
74
``django.contrib.auth.context_processors.PermLookupDict``, respectively.
76
* The :setting:`MEDIA_URL` or :setting:`STATIC_URL` settings will be
77
required to end with a trailing slash to ensure there is a consistent
78
way to combine paths in templates.
80
* ``django.db.models.fields.URLField.verify_exists`` will be removed. The
81
feature was deprecated in 1.3.1 due to intractable security and
82
performance issues and will follow a slightly accelerated deprecation
85
* Translations located under the so-called *project path* will be ignored during
86
the translation building process performed at runtime. The
87
:setting:`LOCALE_PATHS` setting can be used for the same task by including the
88
filesystem path to a ``locale`` directory containing non-app-specific
89
translations in its value.
91
* The Markup contrib app will no longer support versions of Python-Markdown
92
library earlier than 2.1. An accelerated timeline was used as this was
93
a security related deprecation.
95
* The ``CACHE_BACKEND`` setting will be removed. The cache backend(s) should be
96
specified in the :setting:`CACHES` setting.
128
217
* The ``depth`` keyword argument will be removed from
129
218
:meth:`~django.db.models.query.QuerySet.select_related`.
131
* The undocumented ``get_warnings_state()``/``restore_warnings_state()``
132
functions from :mod:`django.test.utils` and the ``save_warnings_state()``/
133
``restore_warnings_state()``
134
:ref:`django.test.*TestCase <django-testcase-subclasses>` methods are
135
deprecated. Use the :class:`warnings.catch_warnings` context manager
136
available starting with Python 2.6 instead.
138
* The undocumented ``check_for_test_cookie`` method in
139
:class:`~django.contrib.auth.forms.AuthenticationForm` will be removed
140
following an accelerated deprecation. Users subclassing this form should
141
remove calls to this method, and instead ensure that their auth related views
142
are CSRF protected, which ensures that cookies are enabled.
144
* The version of :func:`django.contrib.auth.views.password_reset_confirm` that
145
supports base36 encoded user IDs
146
(``django.contrib.auth.views.password_reset_confirm_uidb36``) will be
147
removed. If your site has been running Django 1.6 for more than
148
:setting:`PASSWORD_RESET_TIMEOUT_DAYS`, this change will have no effect. If
149
not, then any password reset links generated before you upgrade to Django 1.7
150
won't work after the upgrade.
155
* ``django.contrib.comments`` will be removed.
157
* The following transaction management APIs will be removed:
159
- ``TransactionMiddleware``,
160
- the decorators and context managers ``autocommit``, ``commit_on_success``,
161
and ``commit_manually``, defined in ``django.db.transaction``,
162
- the functions ``commit_unless_managed`` and ``rollback_unless_managed``,
163
also defined in ``django.db.transaction``,
164
- the ``TRANSACTIONS_MANAGED`` setting.
166
Upgrade paths are described in the :ref:`transaction management docs
167
<transactions-upgrading-from-1.5>`.
169
* The :ttag:`cycle` and :ttag:`firstof` template tags will auto-escape their
170
arguments. In 1.6 and 1.7, this behavior is provided by the version of these
171
tags in the ``future`` template tag library.
173
* The ``SEND_BROKEN_LINK_EMAILS`` setting will be removed. Add the
174
:class:`django.middleware.common.BrokenLinkEmailsMiddleware` middleware to
175
your :setting:`MIDDLEWARE_CLASSES` setting instead.
177
* ``django.middleware.doc.XViewMiddleware`` will be removed. Use
178
``django.contrib.admindocs.middleware.XViewMiddleware`` instead.
180
* ``Model._meta.module_name`` was renamed to ``model_name``.
182
* Remove the backward compatible shims introduced to rename ``get_query_set``
183
and similar queryset methods. This affects the following classes:
184
``BaseModelAdmin``, ``ChangeList``, ``BaseCommentNode``,
185
``GenericForeignKey``, ``Manager``, ``SingleRelatedObjectDescriptor`` and
186
``ReverseSingleRelatedObjectDescriptor``.
188
* Remove the backward compatible shims introduced to rename the attributes
189
``ChangeList.root_query_set`` and ``ChangeList.query_set``.
191
* ``django.views.defaults.shortcut`` will be removed, as part of the
223
* ``django.views.defaults.shortcut()``. This function has been moved
224
to ``django.contrib.contenttypes.views.shortcut()`` as part of the
192
225
goal of removing all ``django.contrib`` references from the core
193
Django codebase. Instead use
194
``django.contrib.contenttypes.views.shortcut``. ``django.conf.urls.shortcut``
195
will also be removed.
197
* Support for the Python Imaging Library (PIL) module will be removed, as it
198
no longer appears to be actively maintained & does not work on Python 3.
199
You are advised to install `Pillow`_, which should be used instead.
201
.. _`Pillow`: https://pypi.python.org/pypi/Pillow
203
* The following private APIs will be removed:
205
- ``django.db.backend``
206
- ``django.db.close_connection()``
207
- ``django.db.backends.creation.BaseDatabaseCreation.set_autocommit()``
208
- ``django.db.transaction.is_managed()``
209
- ``django.db.transaction.managed()``
211
* ``django.forms.widgets.RadioInput`` will be removed in favor of
212
``django.forms.widgets.RadioChoiceInput``.
214
* The module ``django.test.simple`` and the class
215
``django.test.simple.DjangoTestSuiteRunner`` will be removed. Instead use
216
``django.test.runner.DiscoverRunner``.
218
* The module ``django.test._doctest`` will be removed. Instead use the doctest
219
module from the Python standard library.
221
* The ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting will be removed.
223
* Usage of the hard-coded *Hold down "Control", or "Command" on a Mac, to select
224
more than one.* string to override or append to user-provided ``help_text`` in
225
forms for ManyToMany model fields will not be performed by Django anymore
226
either at the model or forms layer.
228
* The ``Model._meta.get_(add|change|delete)_permission`` methods will
226
Django codebase. The old shortcut will be removed in the 2.0
234
229
* ``ssi`` and ``url`` template tags will be removed from the ``future`` template
235
230
tag library (used during the 1.3/1.4 deprecation period).