deprecation.txt 52 KB

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