deprecation.txt 38 KB

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