deprecation.txt 41 KB

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