deprecation.txt 51 KB

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