deprecation.txt 40 KB

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