deprecation.txt 39 KB

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