deprecation.txt 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. ===========================
  2. Django Deprecation Timeline
  3. ===========================
  4. This document outlines when various pieces of Django will be removed or altered
  5. in a backward incompatible way, following their deprecation, as per the
  6. :ref:`deprecation policy <internal-release-deprecation-policy>`. More details
  7. about each item can often be found in the release notes of two versions prior.
  8. .. _deprecation-removed-in-3.0:
  9. 3.0
  10. ---
  11. See the :ref:`Django 2.0 release notes<deprecated-features-2.0>` for more
  12. details on these changes.
  13. * The ``django.db.backends.postgresql_psycopg2`` module will be removed.
  14. * ``django.shortcuts.render_to_response()`` will be removed.
  15. * The ``DEFAULT_CONTENT_TYPE`` setting will be removed.
  16. * ``HttpRequest.xreadlines()`` will be removed.
  17. * Support for the ``context`` argument of ``Field.from_db_value()`` and
  18. ``Expression.convert_value()`` will be removed.
  19. * The ``field_name`` keyword argument of ``QuerySet.earliest()`` and
  20. ``latest()`` will be removed.
  21. .. _deprecation-removed-in-2.1:
  22. 2.1
  23. ---
  24. See the :ref:`Django 1.11 release notes<deprecated-features-1.11>` for more
  25. details on these changes.
  26. * ``contrib.auth.views.login()``, ``logout()``, ``password_change()``,
  27. ``password_change_done()``, ``password_reset()``, ``password_reset_done()``,
  28. ``password_reset_confirm()``, and ``password_reset_complete()`` will be
  29. removed.
  30. * The ``extra_context`` parameter of ``contrib.auth.views.logout_then_login()``
  31. will be removed.
  32. * ``django.test.runner.setup_databases()`` will be removed.
  33. * ``django.utils.translation.string_concat()`` will be removed.
  34. * ``django.core.cache.backends.memcached.PyLibMCCache`` will no longer support
  35. passing ``pylibmc`` behavior settings as top-level attributes of ``OPTIONS``.
  36. * The ``host`` parameter of ``django.utils.http.is_safe_url()`` will be
  37. removed.
  38. * Silencing of exceptions raised while rendering the ``{% include %}`` template
  39. tag will be removed.
  40. * ``DatabaseIntrospection.get_indexes()`` will be removed.
  41. * The ``authenticate()`` method of authentication backends will require
  42. ``request`` as the first positional argument.
  43. * The ``django.db.models.permalink()`` decorator will be removed.
  44. * The ``USE_ETAGS`` setting will be removed. ``CommonMiddleware`` and
  45. ``django.utils.cache.patch_response_headers()`` will no longer set ETags.
  46. * The ``Model._meta.has_auto_field`` attribute will be removed.
  47. * Support for regular expression groups with ``iLmsu#`` in ``url()`` will be
  48. removed.
  49. * Support for ``Widget.render()`` methods without the ``renderer`` argument
  50. will be removed.
  51. .. _deprecation-removed-in-2.0:
  52. 2.0
  53. ---
  54. See the :ref:`Django 1.9 release notes<deprecated-features-1.9>` for more
  55. details on these changes.
  56. * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` will
  57. be removed.
  58. * ``django.db.backends.base.BaseDatabaseOperations.check_aggregate_support()``
  59. will be removed.
  60. * The ``django.forms.extras`` package will be removed.
  61. * The ``assignment_tag`` helper will be removed.
  62. * The ``host`` argument to ``assertsRedirects`` will be removed. The
  63. compatibility layer which allows absolute URLs to be considered equal to
  64. relative ones when the path is identical will also be removed.
  65. * ``Field.rel`` will be removed.
  66. * ``Field.remote_field.to`` attribute will be removed.
  67. * The ``on_delete`` argument for ``ForeignKey`` and ``OneToOneField`` will be
  68. required.
  69. * ``django.db.models.fields.add_lazy_relation()`` will be removed.
  70. * When time zone support is enabled, database backends that don't support time
  71. zones won't convert aware datetimes to naive values in UTC anymore when such
  72. values are passed as parameters to SQL queries executed outside of the ORM,
  73. e.g. with ``cursor.execute()``.
  74. * The ``django.contrib.auth.tests.utils.skipIfCustomUser()`` decorator will be
  75. removed.
  76. * The ``GeoManager`` and ``GeoQuerySet`` classes will be removed.
  77. * The ``django.contrib.gis.geoip`` module will be removed.
  78. * The ``supports_recursion`` check for template loaders will be removed from:
  79. * ``django.template.engine.Engine.find_template()``
  80. * ``django.template.loader_tags.ExtendsNode.find_template()``
  81. * ``django.template.loaders.base.Loader.supports_recursion()``
  82. * ``django.template.loaders.cached.Loader.supports_recursion()``
  83. * The ``load_template()`` and ``load_template_sources()`` template loader
  84. methods will be removed.
  85. * The ``template_dirs`` argument for template loaders will be removed:
  86. * ``django.template.loaders.base.Loader.get_template()``
  87. * ``django.template.loaders.cached.Loader.cache_key()``
  88. * ``django.template.loaders.cached.Loader.get_template()``
  89. * ``django.template.loaders.cached.Loader.get_template_sources()``
  90. * ``django.template.loaders.filesystem.Loader.get_template_sources()``
  91. * The ``django.template.loaders.base.Loader.__call__()`` method will be
  92. removed.
  93. * Support for custom error views with a single positional parameter will be
  94. dropped.
  95. * The ``mime_type`` attribute of ``django.utils.feedgenerator.Atom1Feed`` and
  96. ``django.utils.feedgenerator.RssFeed`` will be removed in favor of
  97. ``content_type``.
  98. * The ``app_name`` argument to ``django.conf.urls.include()`` will be
  99. removed.
  100. * Support for passing a 3-tuple as the first argument to ``include()`` will
  101. be removed.
  102. * Support for setting a URL instance namespace without an application
  103. namespace will be removed.
  104. * ``Field._get_val_from_obj()`` will be removed in favor of
  105. ``Field.value_from_object()``.
  106. * ``django.template.loaders.eggs.Loader`` will be removed.
  107. * The ``current_app`` parameter to the ``contrib.auth`` views will be removed.
  108. * The ``callable_obj`` keyword argument to
  109. ``SimpleTestCase.assertRaisesMessage()`` will be removed.
  110. * Support for the ``allow_tags`` attribute on ``ModelAdmin`` methods will be
  111. removed.
  112. * The ``enclosure`` keyword argument to ``SyndicationFeed.add_item()`` will be
  113. removed.
  114. * The ``django.template.loader.LoaderOrigin`` and
  115. ``django.template.base.StringOrigin`` aliases for
  116. ``django.template.base.Origin`` will be removed.
  117. See the :ref:`Django 1.10 release notes <deprecated-features-1.10>` for more
  118. details on these changes.
  119. * The ``makemigrations --exit`` option will be removed.
  120. * Support for direct assignment to a reverse foreign key or many-to-many
  121. relation will be removed.
  122. * The ``get_srid()`` and ``set_srid()`` methods of
  123. ``django.contrib.gis.geos.GEOSGeometry`` will be removed.
  124. * The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and
  125. ``set_z()`` methods of ``django.contrib.gis.geos.Point`` will be removed.
  126. * The ``get_coords()`` and ``set_coords()`` methods of
  127. ``django.contrib.gis.geos.Point`` will be removed.
  128. * The ``cascaded_union`` property of ``django.contrib.gis.geos.MultiPolygon``
  129. will be removed.
  130. * ``django.utils.functional.allow_lazy()`` will be removed.
  131. * The ``shell --plain`` option will be removed.
  132. * The ``django.core.urlresolvers`` module will be removed.
  133. * The model ``CommaSeparatedIntegerField`` will be removed. A stub field will
  134. remain for compatibility with historical migrations.
  135. * Support for the template ``Context.has_key()`` method will be removed.
  136. * Support for the ``django.core.files.storage.Storage.accessed_time()``,
  137. ``created_time()``, and ``modified_time()`` methods will be removed.
  138. * Support for query lookups using the model name when
  139. ``Meta.default_related_name`` is set will be removed.
  140. * The ``__search`` query lookup and the
  141. ``DatabaseOperations.fulltext_search_sql()`` method will be removed.
  142. * The shim for supporting custom related manager classes without a
  143. ``_apply_rel_filters()`` method will be removed.
  144. * Using ``User.is_authenticated()`` and ``User.is_anonymous()`` as methods
  145. will no longer be supported.
  146. * The private attribute ``virtual_fields`` of ``Model._meta`` will be removed.
  147. * The private keyword arguments ``virtual_only`` in
  148. ``Field.contribute_to_class()`` and ``virtual`` in
  149. ``Model._meta.add_field()`` will be removed.
  150. * The ``javascript_catalog()`` and ``json_catalog()`` views will be removed.
  151. * The ``django.contrib.gis.utils.precision_wkt()`` function will be removed.
  152. * In multi-table inheritance, implicit promotion of a ``OneToOneField`` to a
  153. ``parent_link`` will be removed.
  154. * Support for ``Widget._format_value()`` will be removed.
  155. * ``FileField`` methods ``get_directory_name()`` and ``get_filename()`` will be
  156. removed.
  157. * The ``mark_for_escaping()`` function and the classes it uses: ``EscapeData``,
  158. ``EscapeBytes``, ``EscapeText``, ``EscapeString``, and ``EscapeUnicode`` will
  159. be removed.
  160. * The ``escape`` filter will change to use
  161. ``django.utils.html.conditional_escape()``.
  162. * ``Manager.use_for_related_fields`` will be removed.
  163. * Model ``Manager`` inheritance will follow MRO inheritance rules and the
  164. ``Meta.manager_inheritance_from_future`` to opt-in to this behavior will be
  165. removed.
  166. * Support for old-style middleware using ``settings.MIDDLEWARE_CLASSES`` will
  167. be removed.
  168. .. _deprecation-removed-in-1.10:
  169. 1.10
  170. ----
  171. See the :ref:`Django 1.8 release notes<deprecated-features-1.8>` for more
  172. details on these changes.
  173. * Support for calling a ``SQLCompiler`` directly as an alias for calling its
  174. ``quote_name_unless_alias`` method will be removed.
  175. * ``cycle`` and ``firstof`` template tags will be removed from the ``future``
  176. template tag library (used during the 1.6/1.7 deprecation period).
  177. * ``django.conf.urls.patterns()`` will be removed.
  178. * Support for the ``prefix`` argument to
  179. ``django.conf.urls.i18n.i18n_patterns()`` will be removed.
  180. * ``SimpleTestCase.urls`` will be removed.
  181. * Using an incorrect count of unpacked values in the ``for`` template tag
  182. will raise an exception rather than fail silently.
  183. * The ability to reverse URLs using a dotted Python path will be removed.
  184. * The ability to use a dotted Python path for the ``LOGIN_URL`` and
  185. ``LOGIN_REDIRECT_URL`` settings will be removed.
  186. * Support for :py:mod:`optparse` will be dropped for custom management commands
  187. (replaced by :py:mod:`argparse`).
  188. * The class ``django.core.management.NoArgsCommand`` will be removed. Use
  189. :class:`~django.core.management.BaseCommand` instead, which takes no arguments
  190. by default.
  191. * ``django.core.context_processors`` module will be removed.
  192. * ``django.db.models.sql.aggregates`` module will be removed.
  193. * ``django.contrib.gis.db.models.sql.aggregates`` module will be removed.
  194. * The following methods and properties of ``django.db.sql.query.Query`` will
  195. be removed:
  196. * Properties: ``aggregates`` and ``aggregate_select``
  197. * Methods: ``add_aggregate``, ``set_aggregate_mask``, and
  198. ``append_aggregate_mask``.
  199. * ``django.template.resolve_variable`` will be removed.
  200. * The following private APIs will be removed from
  201. :class:`django.db.models.options.Options` (``Model._meta``):
  202. * ``get_field_by_name()``
  203. * ``get_all_field_names()``
  204. * ``get_fields_with_model()``
  205. * ``get_concrete_fields_with_model()``
  206. * ``get_m2m_with_model()``
  207. * ``get_all_related_objects()``
  208. * ``get_all_related_objects_with_model()``
  209. * ``get_all_related_many_to_many_objects()``
  210. * ``get_all_related_m2m_objects_with_model()``
  211. * The ``error_message`` argument of ``django.forms.RegexField`` will be removed.
  212. * The ``unordered_list`` filter will no longer support old style lists.
  213. * Support for string ``view`` arguments to ``url()`` will be removed.
  214. * The backward compatible shim to rename ``django.forms.Form._has_changed()``
  215. to ``has_changed()`` will be removed.
  216. * The ``removetags`` template filter will be removed.
  217. * The ``remove_tags()`` and ``strip_entities()`` functions in
  218. ``django.utils.html`` will be removed.
  219. * The ``is_admin_site`` argument to
  220. ``django.contrib.auth.views.password_reset()`` will be removed.
  221. * ``django.db.models.field.subclassing.SubfieldBase`` will be removed.
  222. * ``django.utils.checksums`` will be removed; its functionality is included
  223. in ``django-localflavor`` 1.1+.
  224. * The ``original_content_type_id`` attribute on
  225. ``django.contrib.admin.helpers.InlineAdminForm`` will be removed.
  226. * The backwards compatibility shim to allow ``FormMixin.get_form()`` to be
  227. defined with no default value for its ``form_class`` argument will be removed.
  228. * The following settings will be removed:
  229. * ``ALLOWED_INCLUDE_ROOTS``
  230. * ``TEMPLATE_CONTEXT_PROCESSORS``
  231. * ``TEMPLATE_DEBUG``
  232. * ``TEMPLATE_DIRS``
  233. * ``TEMPLATE_LOADERS``
  234. * ``TEMPLATE_STRING_IF_INVALID``
  235. * The backwards compatibility alias ``django.template.loader.BaseLoader`` will
  236. be removed.
  237. * Django template objects returned by
  238. :func:`~django.template.loader.get_template` and
  239. :func:`~django.template.loader.select_template` won't accept a
  240. :class:`~django.template.Context` in their
  241. :meth:`~django.template.backends.base.Template.render()` method anymore.
  242. * :doc:`Template response APIs </ref/template-response>` will enforce the use
  243. of :class:`dict` and backend-dependent template objects instead of
  244. :class:`~django.template.Context` and :class:`~django.template.Template`
  245. respectively.
  246. * The ``current_app`` parameter for the following function and classes will be
  247. removed:
  248. * ``django.shortcuts.render()``
  249. * ``django.template.Context()``
  250. * ``django.template.RequestContext()``
  251. * ``django.template.response.TemplateResponse()``
  252. * The ``dictionary`` and ``context_instance`` parameters for the following
  253. functions will be removed:
  254. * ``django.shortcuts.render()``
  255. * ``django.shortcuts.render_to_response()``
  256. * ``django.template.loader.render_to_string()``
  257. * The ``dirs`` parameter for the following functions will be removed:
  258. * ``django.template.loader.get_template()``
  259. * ``django.template.loader.select_template()``
  260. * ``django.shortcuts.render()``
  261. * ``django.shortcuts.render_to_response()``
  262. * Session verification will be enabled regardless of whether or not
  263. ``'django.contrib.auth.middleware.SessionAuthenticationMiddleware'`` is in
  264. ``MIDDLEWARE_CLASSES``.
  265. * Private attribute ``django.db.models.Field.related`` will be removed.
  266. * The ``--list`` option of the ``migrate`` management command will be removed.
  267. * The ``ssi`` template tag will be removed.
  268. * Support for the ``=`` comparison operator in the ``if`` template tag will be
  269. removed.
  270. * The backwards compatibility shims to allow ``Storage.get_available_name()``
  271. and ``Storage.save()`` to be defined without a ``max_length`` argument will
  272. be removed.
  273. * Support for the legacy ``%(<foo>)s`` syntax in ``ModelFormMixin.success_url``
  274. will be removed.
  275. * ``GeoQuerySet`` aggregate methods ``collect()``, ``extent()``, ``extent3d()``,
  276. ``make_line()``, and ``unionagg()`` will be removed.
  277. * Ability to specify ``ContentType.name`` when creating a content type instance
  278. will be removed.
  279. * Support for the old signature of ``allow_migrate`` will be removed. It changed
  280. from ``allow_migrate(self, db, model)`` to
  281. ``allow_migrate(self, db, app_label, model_name=None, **hints)``.
  282. * Support for the syntax of ``{% cycle %}`` that uses comma-separated arguments
  283. will be removed.
  284. * The warning that :class:`~django.core.signing.Signer` issues when given an
  285. invalid separator will become an exception.
  286. .. _deprecation-removed-in-1.9:
  287. 1.9
  288. ---
  289. See the :ref:`Django 1.7 release notes<deprecated-features-1.7>` for more
  290. details on these changes.
  291. * ``django.utils.dictconfig`` will be removed.
  292. * ``django.utils.importlib`` will be removed.
  293. * ``django.utils.tzinfo`` will be removed.
  294. * ``django.utils.unittest`` will be removed.
  295. * The ``syncdb`` command will be removed.
  296. * ``django.db.models.signals.pre_syncdb`` and
  297. ``django.db.models.signals.post_syncdb`` will be removed.
  298. * ``allow_syncdb`` on database routers will no longer automatically become
  299. ``allow_migrate``.
  300. * Automatic syncing of apps without migrations will be removed. Migrations will
  301. become compulsory for all apps unless you pass the ``--run-syncdb`` option to
  302. ``migrate``.
  303. * The SQL management commands for apps without migrations, ``sql``, ``sqlall``,
  304. ``sqlclear``, ``sqldropindexes``, and ``sqlindexes``, will be removed.
  305. * Support for automatic loading of ``initial_data`` fixtures and initial SQL
  306. data will be removed.
  307. * All models will need to be defined inside an installed application or
  308. declare an explicit :attr:`~django.db.models.Options.app_label`.
  309. Furthermore, it won't be possible to import them before their application
  310. is loaded. In particular, it won't be possible to import models inside
  311. the root package of their application.
  312. * The model and form ``IPAddressField`` will be removed. A stub field will
  313. remain for compatibility with historical migrations.
  314. * ``AppCommand.handle_app()`` will no longer be supported.
  315. * ``RequestSite`` and ``get_current_site()`` will no longer be importable from
  316. ``django.contrib.sites.models``.
  317. * FastCGI support via the ``runfcgi`` management command will be
  318. removed. Please deploy your project using WSGI.
  319. * ``django.utils.datastructures.SortedDict`` will be removed. Use
  320. :class:`collections.OrderedDict` from the Python standard library instead.
  321. * ``ModelAdmin.declared_fieldsets`` will be removed.
  322. * Instances of ``util.py`` in the Django codebase have been renamed to
  323. ``utils.py`` in an effort to unify all util and utils references.
  324. The modules that provided backwards compatibility will be removed:
  325. * ``django.contrib.admin.util``
  326. * ``django.contrib.gis.db.backends.util``
  327. * ``django.db.backends.util``
  328. * ``django.forms.util``
  329. * ``ModelAdmin.get_formsets`` will be removed.
  330. * The backward compatibility shim introduced to rename the
  331. ``BaseMemcachedCache._get_memcache_timeout()`` method to
  332. ``get_backend_timeout()`` will be removed.
  333. * The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` will be removed.
  334. * The ``use_natural_keys`` argument for ``serializers.serialize()`` will be
  335. removed.
  336. * Private API ``django.forms.forms.get_declared_fields()`` will be removed.
  337. * The ability to use a ``SplitDateTimeWidget`` with ``DateTimeField`` will be
  338. removed.
  339. * The ``WSGIRequest.REQUEST`` property will be removed.
  340. * The class ``django.utils.datastructures.MergeDict`` will be removed.
  341. * The ``zh-cn`` and ``zh-tw`` language codes will be removed and have been
  342. replaced by the ``zh-hans`` and ``zh-hant`` language code respectively.
  343. * The internal ``django.utils.functional.memoize`` will be removed.
  344. * ``django.core.cache.get_cache`` will be removed. Add suitable entries
  345. to :setting:`CACHES` and use :data:`django.core.cache.caches` instead.
  346. * ``django.db.models.loading`` will be removed.
  347. * Passing callable arguments to querysets will no longer be possible.
  348. * ``BaseCommand.requires_model_validation`` will be removed in favor of
  349. ``requires_system_checks``. Admin validators will be replaced by admin
  350. checks.
  351. * The ``ModelAdmin.validator_class`` and ``default_validator_class`` attributes
  352. will be removed.
  353. * ``ModelAdmin.validate()`` will be removed.
  354. * ``django.db.backends.DatabaseValidation.validate_field`` will be removed in
  355. favor of the ``check_field`` method.
  356. * The ``validate`` management command will be removed.
  357. * ``django.utils.module_loading.import_by_path`` will be removed in favor of
  358. ``django.utils.module_loading.import_string``.
  359. * ``ssi`` and ``url`` template tags will be removed from the ``future`` template
  360. tag library (used during the 1.3/1.4 deprecation period).
  361. * ``django.utils.text.javascript_quote`` will be removed.
  362. * Database test settings as independent entries in the database settings,
  363. prefixed by ``TEST_``, will no longer be supported.
  364. * The `cache_choices` option to :class:`~django.forms.ModelChoiceField` and
  365. :class:`~django.forms.ModelMultipleChoiceField` will be removed.
  366. * The default value of the
  367. :attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
  368. attribute will change from ``True`` to ``False``.
  369. * ``django.contrib.sitemaps.FlatPageSitemap`` will be removed in favor of
  370. ``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
  371. * Private API ``django.test.utils.TestTemplateLoader`` will be removed.
  372. * The ``django.contrib.contenttypes.generic`` module will be removed.
  373. * Private APIs ``django.db.models.sql.where.WhereNode.make_atom()`` and
  374. ``django.db.models.sql.where.Constraint`` will be removed.
  375. .. _deprecation-removed-in-1.8:
  376. 1.8
  377. ---
  378. See the :ref:`Django 1.6 release notes<deprecated-features-1.6>` for more
  379. details on these changes.
  380. * ``django.contrib.comments`` will be removed.
  381. * The following transaction management APIs will be removed:
  382. - ``TransactionMiddleware``,
  383. - the decorators and context managers ``autocommit``, ``commit_on_success``,
  384. and ``commit_manually``, defined in ``django.db.transaction``,
  385. - the functions ``commit_unless_managed`` and ``rollback_unless_managed``,
  386. also defined in ``django.db.transaction``,
  387. - the ``TRANSACTIONS_MANAGED`` setting.
  388. * The :ttag:`cycle` and :ttag:`firstof` template tags will auto-escape their
  389. arguments. In 1.6 and 1.7, this behavior is provided by the version of these
  390. tags in the ``future`` template tag library.
  391. * The ``SEND_BROKEN_LINK_EMAILS`` setting will be removed. Add the
  392. :class:`django.middleware.common.BrokenLinkEmailsMiddleware` middleware to
  393. your ``MIDDLEWARE_CLASSES`` setting instead.
  394. * ``django.middleware.doc.XViewMiddleware`` will be removed. Use
  395. ``django.contrib.admindocs.middleware.XViewMiddleware`` instead.
  396. * ``Model._meta.module_name`` was renamed to ``model_name``.
  397. * Remove the backward compatible shims introduced to rename ``get_query_set``
  398. and similar queryset methods. This affects the following classes:
  399. ``BaseModelAdmin``, ``ChangeList``, ``BaseCommentNode``,
  400. ``GenericForeignKey``, ``Manager``, ``SingleRelatedObjectDescriptor`` and
  401. ``ReverseSingleRelatedObjectDescriptor``.
  402. * Remove the backward compatible shims introduced to rename the attributes
  403. ``ChangeList.root_query_set`` and ``ChangeList.query_set``.
  404. * ``django.views.defaults.shortcut`` will be removed, as part of the
  405. goal of removing all ``django.contrib`` references from the core
  406. Django codebase. Instead use
  407. ``django.contrib.contenttypes.views.shortcut``. ``django.conf.urls.shortcut``
  408. will also be removed.
  409. * Support for the Python Imaging Library (PIL) module will be removed, as it
  410. no longer appears to be actively maintained & does not work on Python 3.
  411. You are advised to install `Pillow`_, which should be used instead.
  412. .. _`Pillow`: https://pypi.python.org/pypi/Pillow
  413. * The following private APIs will be removed:
  414. - ``django.db.backend``
  415. - ``django.db.close_connection()``
  416. - ``django.db.backends.creation.BaseDatabaseCreation.set_autocommit()``
  417. - ``django.db.transaction.is_managed()``
  418. - ``django.db.transaction.managed()``
  419. * ``django.forms.widgets.RadioInput`` will be removed in favor of
  420. ``django.forms.widgets.RadioChoiceInput``.
  421. * The module ``django.test.simple`` and the class
  422. ``django.test.simple.DjangoTestSuiteRunner`` will be removed. Instead use
  423. ``django.test.runner.DiscoverRunner``.
  424. * The module ``django.test._doctest`` will be removed. Instead use the doctest
  425. module from the Python standard library.
  426. * The ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting will be removed.
  427. * Usage of the hard-coded *Hold down "Control", or "Command" on a Mac, to select
  428. more than one.* string to override or append to user-provided ``help_text`` in
  429. forms for ManyToMany model fields will not be performed by Django anymore
  430. either at the model or forms layer.
  431. * The ``Model._meta.get_(add|change|delete)_permission`` methods will
  432. be removed.
  433. * The session key ``django_language`` will no longer be read for backwards
  434. compatibility.
  435. * Geographic Sitemaps will be removed
  436. (``django.contrib.gis.sitemaps.views.index`` and
  437. ``django.contrib.gis.sitemaps.views.sitemap``).
  438. * ``django.utils.html.fix_ampersands``, the ``fix_ampersands`` template filter and
  439. ``django.utils.html.clean_html`` will be removed following an accelerated deprecation.
  440. .. _deprecation-removed-in-1.7:
  441. 1.7
  442. ---
  443. See the :ref:`Django 1.5 release notes<deprecated-features-1.5>` for more
  444. details on these changes.
  445. * The module ``django.utils.simplejson`` will be removed. The standard library
  446. provides :mod:`json` which should be used instead.
  447. * The function ``django.utils.itercompat.product`` will be removed. The Python
  448. builtin version should be used instead.
  449. * Auto-correction of INSTALLED_APPS and TEMPLATE_DIRS settings when they are
  450. specified as a plain string instead of a tuple will be removed and raise an
  451. exception.
  452. * The ``mimetype`` argument to the ``__init__`` methods of
  453. :class:`~django.http.HttpResponse`,
  454. :class:`~django.template.response.SimpleTemplateResponse`, and
  455. :class:`~django.template.response.TemplateResponse`, will be removed.
  456. ``content_type`` should be used instead. This also applies to the
  457. ``render_to_response()`` shortcut and the sitemap views,
  458. :func:`~django.contrib.sitemaps.views.index` and
  459. :func:`~django.contrib.sitemaps.views.sitemap`.
  460. * When :class:`~django.http.HttpResponse` is instantiated with an iterator,
  461. or when :attr:`~django.http.HttpResponse.content` is set to an iterator,
  462. that iterator will be immediately consumed.
  463. * The ``AUTH_PROFILE_MODULE`` setting, and the ``get_profile()`` method on
  464. the User model, will be removed.
  465. * The ``cleanup`` management command will be removed. It's replaced by
  466. ``clearsessions``.
  467. * The ``daily_cleanup.py`` script will be removed.
  468. * The ``depth`` keyword argument will be removed from
  469. :meth:`~django.db.models.query.QuerySet.select_related`.
  470. * The undocumented ``get_warnings_state()``/``restore_warnings_state()``
  471. functions from :mod:`django.test.utils` and the ``save_warnings_state()``/
  472. ``restore_warnings_state()``
  473. :ref:`django.test.*TestCase <django-testcase-subclasses>` methods are
  474. deprecated. Use the :class:`warnings.catch_warnings` context manager
  475. available starting with Python 2.6 instead.
  476. * The undocumented ``check_for_test_cookie`` method in
  477. :class:`~django.contrib.auth.forms.AuthenticationForm` will be removed
  478. following an accelerated deprecation. Users subclassing this form should
  479. remove calls to this method, and instead ensure that their auth related views
  480. are CSRF protected, which ensures that cookies are enabled.
  481. * The version of ``django.contrib.auth.views.password_reset_confirm()`` that
  482. supports base36 encoded user IDs
  483. (``django.contrib.auth.views.password_reset_confirm_uidb36``) will be
  484. removed. If your site has been running Django 1.6 for more than
  485. :setting:`PASSWORD_RESET_TIMEOUT_DAYS`, this change will have no effect. If
  486. not, then any password reset links generated before you upgrade to Django 1.7
  487. won't work after the upgrade.
  488. * The ``django.utils.encoding.StrAndUnicode`` mix-in will be removed.
  489. Define a ``__str__`` method and apply the
  490. :func:`~django.utils.encoding.python_2_unicode_compatible` decorator instead.
  491. .. _deprecation-removed-in-1.6:
  492. 1.6
  493. ---
  494. See the :ref:`Django 1.4 release notes<deprecated-features-1.4>` for more
  495. details on these changes.
  496. * ``django.contrib.databrowse`` will be removed.
  497. * ``django.contrib.localflavor`` will be removed following an accelerated
  498. deprecation.
  499. * ``django.contrib.markup`` will be removed following an accelerated
  500. deprecation.
  501. * The compatibility modules ``django.utils.copycompat`` and
  502. ``django.utils.hashcompat`` as well as the functions
  503. ``django.utils.itercompat.all`` and ``django.utils.itercompat.any`` will
  504. be removed. The Python builtin versions should be used instead.
  505. * The ``csrf_response_exempt`` and ``csrf_view_exempt`` decorators will
  506. be removed. Since 1.4 ``csrf_response_exempt`` has been a no-op (it
  507. returns the same function), and ``csrf_view_exempt`` has been a
  508. synonym for ``django.views.decorators.csrf.csrf_exempt``, which should
  509. be used to replace it.
  510. * The ``django.core.cache.backends.memcached.CacheClass`` backend
  511. was split into two in Django 1.3 in order to introduce support for
  512. PyLibMC. The historical ``CacheClass`` will be removed in favor of
  513. ``django.core.cache.backends.memcached.MemcachedCache``.
  514. * The UK-prefixed objects of ``django.contrib.localflavor.uk`` will only
  515. be accessible through their GB-prefixed names (GB is the correct
  516. ISO 3166 code for United Kingdom).
  517. * The ``IGNORABLE_404_STARTS`` and ``IGNORABLE_404_ENDS`` settings have been
  518. superseded by :setting:`IGNORABLE_404_URLS` in the 1.4 release. They will be
  519. removed.
  520. * The form wizard has been refactored to use class-based views with pluggable
  521. backends in 1.4. The previous implementation will be removed.
  522. * Legacy ways of calling
  523. :func:`~django.views.decorators.cache.cache_page` will be removed.
  524. * The backward-compatibility shim to automatically add a debug-false
  525. filter to the ``'mail_admins'`` logging handler will be removed. The
  526. :setting:`LOGGING` setting should include this filter explicitly if
  527. it is desired.
  528. * The builtin truncation functions ``django.utils.text.truncate_words()``
  529. and ``django.utils.text.truncate_html_words()`` will be removed in
  530. favor of the ``django.utils.text.Truncator`` class.
  531. * The ``django.contrib.gis.geoip.GeoIP`` class was moved to
  532. ``django.contrib.gis.geoip`` in 1.4 -- the shortcut in
  533. ``django.contrib.gis.utils`` will be removed.
  534. * ``django.conf.urls.defaults`` will be removed. The functions
  535. ``include()``, ``patterns()``, and ``url()``, plus
  536. :data:`~django.conf.urls.handler404` and :data:`~django.conf.urls.handler500`
  537. are now available through ``django.conf.urls``.
  538. * The functions ``setup_environ()`` and ``execute_manager()`` will be removed
  539. from :mod:`django.core.management`. This also means that the old (pre-1.4)
  540. style of :file:`manage.py` file will no longer work.
  541. * Setting the ``is_safe`` and ``needs_autoescape`` flags as attributes of
  542. template filter functions will no longer be supported.
  543. * The attribute ``HttpRequest.raw_post_data`` was renamed to ``HttpRequest.body``
  544. in 1.4. The backward compatibility will be removed --
  545. ``HttpRequest.raw_post_data`` will no longer work.
  546. * The value for the ``post_url_continue`` parameter in
  547. ``ModelAdmin.response_add()`` will have to be either ``None`` (to redirect
  548. to the newly created object's edit page) or a pre-formatted url. String
  549. formats, such as the previous default ``'../%s/'``, will not be accepted any
  550. more.
  551. .. _deprecation-removed-in-1.5:
  552. 1.5
  553. ---
  554. See the :ref:`Django 1.3 release notes<deprecated-features-1.3>` for more
  555. details on these changes.
  556. * Starting Django without a :setting:`SECRET_KEY` will result in an exception
  557. rather than a ``DeprecationWarning``. (This is accelerated from the usual
  558. deprecation path; see the :doc:`Django 1.4 release notes</releases/1.4>`.)
  559. * The ``mod_python`` request handler will be removed. The ``mod_wsgi``
  560. handler should be used instead.
  561. * The ``template`` attribute on ``django.test.client.Response``
  562. objects returned by the :ref:`test client <test-client>` will be removed.
  563. The :attr:`~django.test.Response.templates` attribute should be
  564. used instead.
  565. * The ``django.test.simple.DjangoTestRunner`` will be removed.
  566. Instead use a unittest-native class. The features of the
  567. ``django.test.simple.DjangoTestRunner`` (including fail-fast and
  568. Ctrl-C test termination) can currently be provided by the unittest-native
  569. :class:`~unittest.TextTestRunner`.
  570. * The undocumented function
  571. ``django.contrib.formtools.utils.security_hash`` will be removed,
  572. instead use ``django.contrib.formtools.utils.form_hmac``
  573. * The function-based generic view modules will be removed in favor of their
  574. class-based equivalents, outlined :doc:`here
  575. </topics/class-based-views/index>`.
  576. * The ``django.core.servers.basehttp.AdminMediaHandler`` will be
  577. removed. In its place use
  578. ``django.contrib.staticfiles.handlers.StaticFilesHandler``.
  579. * The template tags library ``adminmedia`` and the template tag ``{%
  580. admin_media_prefix %}`` will be removed in favor of the generic static files
  581. handling. (This is faster than the usual deprecation path; see the
  582. :doc:`Django 1.4 release notes</releases/1.4>`.)
  583. * The ``url`` and ``ssi`` template tags will be modified so that the first
  584. argument to each tag is a template variable, not an implied string. In 1.4,
  585. this behavior is provided by a version of the tag in the ``future`` template
  586. tag library.
  587. * The ``reset`` and ``sqlreset`` management commands will be removed.
  588. * Authentication backends will need to support an inactive user
  589. being passed to all methods dealing with permissions.
  590. The ``supports_inactive_user`` attribute will no longer be checked
  591. and can be removed from custom backends.
  592. * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise
  593. a :class:`~django.contrib.gis.geos.GEOSException` when called
  594. on a geometry with no SRID value.
  595. * ``django.http.CompatCookie`` will be removed in favor of
  596. ``django.http.SimpleCookie``.
  597. * ``django.core.context_processors.PermWrapper`` and
  598. ``django.core.context_processors.PermLookupDict`` will be removed in
  599. favor of the corresponding
  600. ``django.contrib.auth.context_processors.PermWrapper`` and
  601. ``django.contrib.auth.context_processors.PermLookupDict``, respectively.
  602. * The :setting:`MEDIA_URL` or :setting:`STATIC_URL` settings will be
  603. required to end with a trailing slash to ensure there is a consistent
  604. way to combine paths in templates.
  605. * ``django.db.models.fields.URLField.verify_exists`` will be removed. The
  606. feature was deprecated in 1.3.1 due to intractable security and
  607. performance issues and will follow a slightly accelerated deprecation
  608. timeframe.
  609. * Translations located under the so-called *project path* will be ignored during
  610. the translation building process performed at runtime. The
  611. :setting:`LOCALE_PATHS` setting can be used for the same task by including the
  612. filesystem path to a ``locale`` directory containing non-app-specific
  613. translations in its value.
  614. * The Markup contrib app will no longer support versions of Python-Markdown
  615. library earlier than 2.1. An accelerated timeline was used as this was
  616. a security related deprecation.
  617. * The ``CACHE_BACKEND`` setting will be removed. The cache backend(s) should be
  618. specified in the :setting:`CACHES` setting.
  619. .. _deprecation-removed-in-1.4:
  620. 1.4
  621. ---
  622. See the :ref:`Django 1.2 release notes<deprecated-features-1.2>` for more
  623. details on these changes.
  624. * ``CsrfResponseMiddleware`` and ``CsrfMiddleware`` will be removed. Use
  625. the ``{% csrf_token %}`` template tag inside forms to enable CSRF
  626. protection. ``CsrfViewMiddleware`` remains and is enabled by default.
  627. * The old imports for CSRF functionality (``django.contrib.csrf.*``),
  628. which moved to core in 1.2, will be removed.
  629. * The ``django.contrib.gis.db.backend`` module will be removed in favor
  630. of the specific backends.
  631. * ``SMTPConnection`` will be removed in favor of a generic Email backend API.
  632. * The many to many SQL generation functions on the database backends
  633. will be removed.
  634. * The ability to use the ``DATABASE_*`` family of top-level settings to
  635. define database connections will be removed.
  636. * The ability to use shorthand notation to specify a database backend
  637. (i.e., ``sqlite3`` instead of ``django.db.backends.sqlite3``) will be
  638. removed.
  639. * The ``get_db_prep_save``, ``get_db_prep_value`` and
  640. ``get_db_prep_lookup`` methods will have to support multiple databases.
  641. * The ``Message`` model (in ``django.contrib.auth``), its related
  642. manager in the ``User`` model (``user.message_set``), and the
  643. associated methods (``user.message_set.create()`` and
  644. ``user.get_and_delete_messages()``), will be removed. The
  645. :doc:`messages framework </ref/contrib/messages>` should be used
  646. instead. The related ``messages`` variable returned by the
  647. auth context processor will also be removed. Note that this
  648. means that the admin application will depend on the messages
  649. context processor.
  650. * Authentication backends will need to support the ``obj`` parameter for
  651. permission checking. The ``supports_object_permissions`` attribute
  652. will no longer be checked and can be removed from custom backends.
  653. * Authentication backends will need to support the ``AnonymousUser`` class
  654. being passed to all methods dealing with permissions. The
  655. ``supports_anonymous_user`` variable will no longer be checked and can be
  656. removed from custom backends.
  657. * The ability to specify a callable template loader rather than a
  658. ``Loader`` class will be removed, as will the ``load_template_source``
  659. functions that are included with the built in template loaders for
  660. backwards compatibility.
  661. * ``django.utils.translation.get_date_formats()`` and
  662. ``django.utils.translation.get_partial_date_formats()``. These functions
  663. will be removed; use the locale-aware
  664. ``django.utils.formats.get_format()`` to get the appropriate formats.
  665. * In ``django.forms.fields``, the constants: ``DEFAULT_DATE_INPUT_FORMATS``,
  666. ``DEFAULT_TIME_INPUT_FORMATS`` and
  667. ``DEFAULT_DATETIME_INPUT_FORMATS`` will be removed. Use
  668. ``django.utils.formats.get_format()`` to get the appropriate
  669. formats.
  670. * The ability to use a function-based test runner will be removed,
  671. along with the ``django.test.simple.run_tests()`` test runner.
  672. * The ``views.feed()`` view and ``feeds.Feed`` class in
  673. ``django.contrib.syndication`` will be removed. The class-based view
  674. ``views.Feed`` should be used instead.
  675. * ``django.core.context_processors.auth``. This release will
  676. remove the old method in favor of the new method in
  677. ``django.contrib.auth.context_processors.auth``.
  678. * The ``postgresql`` database backend will be removed, use the
  679. ``postgresql_psycopg2`` backend instead.
  680. * The ``no`` language code will be removed and has been replaced by the
  681. ``nb`` language code.
  682. * Authentication backends will need to define the boolean attribute
  683. ``supports_inactive_user`` until version 1.5 when it will be assumed that
  684. all backends will handle inactive users.
  685. * ``django.db.models.fields.XMLField`` will be removed. This was
  686. deprecated as part of the 1.3 release. An accelerated deprecation
  687. schedule has been used because the field hasn't performed any role
  688. beyond that of a simple ``TextField`` since the removal of ``oldforms``.
  689. All uses of ``XMLField`` can be replaced with ``TextField``.
  690. * The undocumented ``mixin`` parameter to the ``open()`` method of
  691. ``django.core.files.storage.Storage`` (and subclasses) will be removed.
  692. .. _deprecation-removed-in-1.3:
  693. 1.3
  694. ---
  695. See the :ref:`Django 1.1 release notes<deprecated-features-1.1>` for more
  696. details on these changes.
  697. * ``AdminSite.root()``. This method of hooking up the admin URLs will be
  698. removed in favor of including ``admin.site.urls``.
  699. * Authentication backends need to define the boolean attributes
  700. ``supports_object_permissions`` and ``supports_anonymous_user`` until
  701. version 1.4, at which point it will be assumed that all backends will
  702. support these options.