deprecation.txt 41 KB

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