deprecation.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. ===========================
  2. Django Deprecation Timeline
  3. ===========================
  4. This document outlines when various pieces of Django will be removed, following
  5. their deprecation, as per the :ref:`Django deprecation policy
  6. <internal-release-deprecation-policy>`
  7. * 1.3
  8. * ``AdminSite.root()``. This release will remove the old method for
  9. hooking up admin URLs. This has been deprecated since the 1.1
  10. release.
  11. * Authentication backends need to define the boolean attributes
  12. ``supports_object_permissions`` and ``supports_anonymous_user``.
  13. The old backend style is deprecated since the 1.2 release.
  14. * The :mod:`django.contrib.gis.db.backend` module, including the
  15. ``SpatialBackend`` interface, is deprecated since the 1.2 release.
  16. * 1.4
  17. * ``CsrfResponseMiddleware``. This has been deprecated since the 1.2
  18. release, in favor of the template tag method for inserting the CSRF
  19. token. ``CsrfMiddleware``, which combines ``CsrfResponseMiddleware``
  20. and ``CsrfViewMiddleware``, is also deprecated.
  21. * The old imports for CSRF functionality (``django.contrib.csrf.*``),
  22. which moved to core in 1.2, will be removed.
  23. * ``SMTPConnection``. The 1.2 release deprecated the ``SMTPConnection``
  24. class in favor of a generic E-mail backend API.
  25. * The many to many SQL generation functions on the database backends
  26. will be removed.
  27. * The ability to use the ``DATABASE_*`` family of top-level settings to
  28. define database connections will be removed.
  29. * The ability to use shorthand notation to specify a database backend
  30. (i.e., ``sqlite3`` instead of ``django.db.backends.sqlite3``) will be
  31. removed.
  32. * The ``get_db_prep_save``, ``get_db_prep_value`` and
  33. ``get_db_prep_lookup`` methods on Field were modified in 1.2
  34. to support multiple databases. In 1.4, the support functions
  35. that allow methods with the old prototype to continue
  36. working will be removed.
  37. * The ``Message`` model (in ``django.contrib.auth``), its related
  38. manager in the ``User`` model (``user.message_set``), and the
  39. associated methods (``user.message_set.create()`` and
  40. ``user.get_and_delete_messages()``), which have
  41. been deprecated since the 1.2 release, will be removed. The
  42. :doc:`messages framework </ref/contrib/messages>` should be used
  43. instead. The related ``messages`` variable returned by the
  44. auth context processor will also be removed. Note that this
  45. means that the admin application depends on the messages
  46. context processor.
  47. * Authentication backends need to support the ``obj`` parameter for
  48. permission checking. The ``supports_object_permissions`` variable
  49. is not checked any longer and can be removed.
  50. * Authentication backends need to support the ``AnonymousUser``
  51. being passed to all methods dealing with permissions.
  52. The ``supports_anonymous_user`` variable is not checked any
  53. longer and can be removed.
  54. * The ability to specify a callable template loader rather than a
  55. ``Loader`` class will be removed, as will the ``load_template_source``
  56. functions that are included with the built in template loaders for
  57. backwards compatibility. These have been deprecated since the 1.2
  58. release.
  59. * ``django.utils.translation.get_date_formats()`` and
  60. ``django.utils.translation.get_partial_date_formats()``. These
  61. functions are replaced by the new locale aware formatting; use
  62. ``django.utils.formats.get_format()`` to get the appropriate
  63. formats.
  64. * In ``django.forms.fields``: ``DEFAULT_DATE_INPUT_FORMATS``,
  65. ``DEFAULT_TIME_INPUT_FORMATS`` and
  66. ``DEFAULT_DATETIME_INPUT_FORMATS``. Use
  67. ``django.utils.formats.get_format()`` to get the appropriate
  68. formats.
  69. * The ability to use a function-based test runners will be removed,
  70. along with the ``django.test.simple.run_tests()`` test runner.
  71. * The ``views.feed()`` view and ``feeds.Feed`` class in
  72. ``django.contrib.syndication`` have been deprecated since the 1.2
  73. release. The class-based view ``views.Feed`` should be used instead.
  74. * ``django.core.context_processors.auth``. This release will
  75. remove the old method in favor of the new method in
  76. ``django.contrib.auth.context_processors.auth``. This has been
  77. deprecated since the 1.2 release.
  78. * The ``postgresql`` database backend has been deprecated in favor of
  79. the ``postgresql_psycopg2`` backend.
  80. * The ``no`` language code has been deprecated in favor of the ``nb``
  81. language code.
  82. * Authentication backends need to define the boolean attribute
  83. ``supports_inactive_user``.
  84. * ``django.db.models.fields.XMLField`` will be removed. This was
  85. deprecated as part of the 1.3 release. An accelerated deprecation
  86. schedule has been used because the field hasn't performed any role
  87. beyond that of a simple ``TextField`` since the removal of oldforms.
  88. All uses of ``XMLField`` can be replaced with ``TextField``.
  89. * 1.5
  90. * The ``mod_python`` request handler has been deprecated since the 1.3
  91. release. The ``mod_wsgi`` handler should be used instead.
  92. * The ``template`` attribute on :class:`~django.test.client.Response`
  93. objects returned by the :ref:`test client <test-client>` has been
  94. deprecated since the 1.3 release. The
  95. :attr:`~django.test.client.Response.templates` attribute should be
  96. used instead.
  97. * The features of the :class:`django.test.simple.DjangoTestRunner`
  98. (including fail-fast and Ctrl-C test termination) can now be provided
  99. by the unittest-native :class:`TextTestRunner`. The
  100. :class:`~django.test.simple.DjangoTestRunner` will be removed in
  101. favor of using the unittest-native class.
  102. * The undocumented function
  103. :func:`django.contrib.formtools.utils.security_hash`
  104. is deprecated, in favor of :func:`django.contrib.formtools.utils.form_hmac`
  105. * The function-based generic views have been deprecated in
  106. favor of their class-based cousins. The following modules
  107. will be removed:
  108. * :mod:`django.views.generic.create_update`
  109. * :mod:`django.views.generic.date_based`
  110. * :mod:`django.views.generic.list_detail`
  111. * :mod:`django.views.generic.simple`
  112. * The :class:`~django.core.servers.basehttp.AdminMediaHandler` has
  113. been deprecated in favor of the
  114. :class:`~django.contrib.staticfiles.handlers.StaticFilesHandler`.
  115. * The :ttag:`url` and :ttag:`ssi` template tags will be
  116. modified so that the first argument to each tag is a
  117. template variable, not an implied string. The new-style
  118. behavior is provided in the ``future`` template tag library.
  119. * The :djadmin:`reset` and :djadmin:`sqlreset` management commands
  120. are deprecated.
  121. * Authentication backends need to support a inactive user
  122. being passed to all methods dealing with permissions.
  123. The ``supports_inactive_user`` variable is not checked any
  124. longer and can be removed.
  125. * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise
  126. a :class:`~django.contrib.gis.geos.GEOSException` when called
  127. on a geometry with no SRID value.
  128. * :class:`~django.http.CompatCookie` will be removed in favor of
  129. :class:`~django.http.SimpleCookie`.
  130. * :class:`django.core.context_processors.PermWrapper` and
  131. :class:`django.core.context_processors.PermLookupDict`
  132. will be moved to :class:`django.contrib.auth.context_processors.PermWrapper`
  133. and :class:`django.contrib.auth.context_processors.PermLookupDict`,
  134. respectively.
  135. * The ``MEDIA_URL`` or ``STATIC_URL`` settings are required to end
  136. with a trailing slash to ensure there is a consistent way to
  137. combine paths in templates.
  138. * 1.6
  139. * The compatibility modules ``django.utils.copycompat`` and
  140. ``django.utils.hashcompat`` as well as the functions
  141. ``django.utils.itercompat.all`` and ``django.utils.itercompat.any``
  142. have been deprecated since the 1.4 release. The native versions
  143. should be used instead.
  144. * The :func:`~django.views.decorators.csrf.csrf_response_exempt` and
  145. :func:`~django.views.decorators.csrf.csrf_view_exempt` decorators will
  146. be removed. Since 1.4 ``csrf_response_exempt`` has been a no-op (it
  147. returns the same function), and ``csrf_view_exempt`` has been a
  148. synonym for ``django.views.decorators.csrf.csrf_exempt``, which should
  149. be used to replace it.
  150. * The :class:`~django.core.cache.backends.memcached.CacheClass` backend
  151. was split into two in Django 1.3 in order to introduce support for
  152. PyLibMC. The historical :class:`~django.core.cache.backends.memcached.CacheClass`
  153. is now an alias for :class:`~django.core.cache.backends.memcached.MemcachedCache`.
  154. In Django 1.6, the historical alias will be removed.
  155. * The UK-prefixed objects of ``django.contrib.localflavor.uk`` will only
  156. be accessible through their new GB-prefixed names (GB is the correct
  157. ISO 3166 code for United Kingdom). They have been deprecated since the
  158. 1.4 release.
  159. * The :setting:`IGNORABLE_404_STARTS` and :setting:`IGNORABLE_404_ENDS`
  160. settings have been superseded by :setting:`IGNORABLE_404_URLS` in
  161. the 1.4 release. They will be removed.
  162. * 2.0
  163. * ``django.views.defaults.shortcut()``. This function has been moved
  164. to ``django.contrib.contenttypes.views.shortcut()`` as part of the
  165. goal of removing all ``django.contrib`` references from the core
  166. Django codebase. The old shortcut will be removed in the 2.0
  167. release.