deprecation.txt 46 KB

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