deprecation.txt 39 KB

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