3.0.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. ============================================
  2. Django 3.0 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected December 2019*
  5. Welcome to Django 3.0!
  6. These release notes cover the :ref:`new features <whats-new-3.0>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-3.0>` you'll
  8. want to be aware of when upgrading from Django 2.2 or earlier. We've
  9. :ref:`dropped some features<removed-features-3.0>` that have reached the end of
  10. their deprecation cycle, and we've :ref:`begun the deprecation process for
  11. some features <deprecated-features-3.0>`.
  12. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  13. project.
  14. Python compatibility
  15. ====================
  16. Django 3.0 supports Python 3.6, 3.7, and 3.8. We **highly recommend** and only
  17. officially support the latest release of each series.
  18. The Django 2.2.x series is the last to support Python 3.5.
  19. Third-party library support for older version of Django
  20. =======================================================
  21. Following the release of Django 3.0, we suggest that third-party app authors
  22. drop support for all versions of Django prior to 2.2. At that time, you should
  23. be able to run your package's tests using ``python -Wd`` so that deprecation
  24. warnings appear. After making the deprecation warning fixes, your app should be
  25. compatible with Django 3.0.
  26. .. _whats-new-3.0:
  27. What's new in Django 3.0
  28. ========================
  29. MariaDB support
  30. ---------------
  31. Django now officially supports `MariaDB <https://mariadb.org/>`_ 10.1 and
  32. higher. See :ref:`MariaDB notes <mariadb-notes>` for more details.
  33. ASGI support
  34. ------------
  35. Django 3.0 begins our journey to making Django fully async-capable by providing
  36. support for running as an `ASGI <https://asgi.readthedocs.io/>`_ application.
  37. This is in addition to our existing WSGI support. Django intends to support
  38. both for the foreseeable future. Async features will only be available to
  39. applications that run under ASGI, however.
  40. There is no need to switch your applications over unless you want to start
  41. experimenting with asynchronous code, but we have
  42. :doc:`documentation on deploying with ASGI </howto/deployment/asgi/index>` if
  43. you want to learn more.
  44. Note that as a side-effect of this change, Django is now aware of asynchronous
  45. event loops and will block you calling code marked as "async unsafe" - such as
  46. ORM operations - from an asynchronous context. If you were using Django from
  47. async code before, this may trigger if you were doing it incorrectly. If you
  48. see a ``SynchronousOnlyOperation`` error, then closely examine your code and
  49. move any database operations to be in a synchronous child thread.
  50. Exclusion constraints on PostgreSQL
  51. -----------------------------------
  52. The new :class:`~django.contrib.postgres.constraints.ExclusionConstraint` class
  53. enable adding exclusion constraints on PostgreSQL. Constraints are added to
  54. models using the
  55. :attr:`Meta.constraints <django.db.models.Options.constraints>` option.
  56. Filter expressions
  57. ------------------
  58. Expressions that outputs :class:`~django.db.models.BooleanField` may now be
  59. used directly in ``QuerySet`` filters, without having to first annotate and
  60. then filter against the annotation.
  61. Minor features
  62. --------------
  63. :mod:`django.contrib.admin`
  64. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. * Added support for the ``admin_order_field`` attribute on properties in
  66. :attr:`.ModelAdmin.list_display`.
  67. * The new :meth:`ModelAdmin.get_inlines()
  68. <django.contrib.admin.ModelAdmin.get_inlines>` method allows specifying the
  69. inlines based on the request or model instance.
  70. * Select2 library is upgraded from version 4.0.3 to 4.0.7.
  71. * jQuery is upgraded from version 3.3.1 to 3.4.1.
  72. :mod:`django.contrib.admindocs`
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. * ...
  75. :mod:`django.contrib.auth`
  76. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  77. * The new ``reset_url_token`` attribute in
  78. :class:`~django.contrib.auth.views.PasswordResetConfirmView` allows specifying
  79. a token parameter displayed as a component of password reset URLs.
  80. * Added :class:`~django.contrib.auth.backends.BaseBackend` class to ease
  81. customization of authentication backends.
  82. * Added :meth:`~django.contrib.auth.models.User.get_user_permissions()` method
  83. to mirror the existing
  84. :meth:`~django.contrib.auth.models.User.get_group_permissions()` method.
  85. * Added HTML ``autocomplete`` attribute to widgets of username, email, and
  86. password fields in :mod:`django.contrib.auth.forms` for better interaction
  87. with browser password managers.
  88. * :djadmin:`createsuperuser` now falls back to environment variables for
  89. password and required fields, when a corresponding command line argument
  90. isn't provided in non-interactive mode.
  91. * :attr:`~django.contrib.auth.models.CustomUser.REQUIRED_FIELDS` now supports
  92. :class:`~django.db.models.ManyToManyField`\s.
  93. :mod:`django.contrib.contenttypes`
  94. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95. * ...
  96. :mod:`django.contrib.gis`
  97. ~~~~~~~~~~~~~~~~~~~~~~~~~
  98. * Allowed MySQL spatial lookup functions to operate on real geometries.
  99. Previous support was limited to bounding boxes.
  100. * Added the :class:`~django.contrib.gis.db.models.functions.GeometryDistance`
  101. function, supported on PostGIS.
  102. * Added support for the ``furlong`` unit in
  103. :class:`~django.contrib.gis.measure.Distance`.
  104. * The :setting:`GEOIP_PATH` setting now supports :class:`pathlib.Path`.
  105. * The :class:`~django.contrib.gis.geoip2.GeoIP2` class now accepts
  106. :class:`pathlib.Path` ``path``.
  107. :mod:`django.contrib.messages`
  108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. * ...
  110. :mod:`django.contrib.postgres`
  111. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112. * The new :class:`~django.contrib.postgres.fields.RangeOperators` helps to
  113. avoid typos in SQL operators that can be used together with
  114. :class:`~django.contrib.postgres.fields.RangeField`.
  115. * The new :class:`~django.contrib.postgres.fields.RangeBoundary` expression
  116. represents the range boundaries.
  117. * The new :class:`~django.contrib.postgres.operations.AddIndexConcurrently`
  118. and :class:`~django.contrib.postgres.operations.RemoveIndexConcurrently`
  119. classes allow creating and dropping indexes ``CONCURRENTLY`` on PostgreSQL.
  120. :mod:`django.contrib.redirects`
  121. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. * ...
  123. :mod:`django.contrib.sessions`
  124. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. * The new
  126. :meth:`~django.contrib.sessions.backends.base.SessionBase.get_session_cookie_age()`
  127. methods allows dynamically specifying the session cookie age.
  128. :mod:`django.contrib.sitemaps`
  129. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. * ...
  131. :mod:`django.contrib.sites`
  132. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  133. * ...
  134. :mod:`django.contrib.staticfiles`
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. * ...
  137. :mod:`django.contrib.syndication`
  138. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. * Added the ``language`` class attribute to the
  140. :class:`django.contrib.syndication.views.Feed` to customize a feed language.
  141. The default value is :func:`~django.utils.translation.get_language()` instead
  142. of :setting:`LANGUAGE_CODE`.
  143. Cache
  144. ~~~~~
  145. * :func:`~django.utils.cache.add_never_cache_headers` and
  146. :func:`~django.views.decorators.cache.never_cache` now adds ``private``
  147. directive to a ``Cache-Control`` header.
  148. CSRF
  149. ~~~~
  150. * ...
  151. Email
  152. ~~~~~
  153. * ...
  154. File Storage
  155. ~~~~~~~~~~~~
  156. * ...
  157. File Uploads
  158. ~~~~~~~~~~~~
  159. * ...
  160. Forms
  161. ~~~~~
  162. * Formsets may control the widget used when ordering forms via
  163. :attr:`~django.forms.formsets.BaseFormSet.can_order` by setting the
  164. :attr:`~django.forms.formsets.BaseFormSet.ordering_widget` attribute or
  165. overriding :attr:`~django.forms.formsets.BaseFormSet.get_ordering_widget()`.
  166. Generic Views
  167. ~~~~~~~~~~~~~
  168. * ...
  169. Internationalization
  170. ~~~~~~~~~~~~~~~~~~~~
  171. * Added the :setting:`LANGUAGE_COOKIE_HTTPONLY`,
  172. :setting:`LANGUAGE_COOKIE_SAMESITE`, and :setting:`LANGUAGE_COOKIE_SECURE`
  173. settings to set the ``HttpOnly``, ``SameSite``, and ``Secure`` flags on
  174. language cookies. The default values of these settings preserve the previous
  175. behavior.
  176. Management Commands
  177. ~~~~~~~~~~~~~~~~~~~
  178. * The new :option:`compilemessages --ignore` option allows ignoring specific
  179. directories when searching for ``.po`` files to compile.
  180. * :option:`showmigrations --list` now shows the applied datetimes when
  181. ``--verbosity`` is 2 and above.
  182. * On PostgreSQL, :djadmin:`dbshell` now supports client-side TLS certificates.
  183. * :djadmin:`inspectdb` now introspects :class:`~django.db.models.OneToOneField`
  184. when a foreign key has a unique or primary key constraint.
  185. * The new :option:`--skip-checks` option skips running system checks prior to
  186. running the command.
  187. * The :option:`startapp --template` and :option:`startproject --template`
  188. options now support templates stored in XZ archives (``.tar.xz``, ``.txz``)
  189. and LZMA archives (``.tar.lzma``, ``.tlz``).
  190. Migrations
  191. ~~~~~~~~~~
  192. * ...
  193. Models
  194. ~~~~~~
  195. * Added hash database functions :class:`~django.db.models.functions.MD5`,
  196. :class:`~django.db.models.functions.SHA1`,
  197. :class:`~django.db.models.functions.SHA224`,
  198. :class:`~django.db.models.functions.SHA256`,
  199. :class:`~django.db.models.functions.SHA384`, and
  200. :class:`~django.db.models.functions.SHA512`.
  201. * Added the :class:`~django.db.models.functions.Sign` database function.
  202. * The new ``is_dst`` parameter of the
  203. :class:`~django.db.models.functions.Trunc` database functions determines the
  204. treatment of nonexistent and ambiguous datetimes.
  205. * ``connection.queries`` now shows ``COPY … TO`` statements on PostgreSQL.
  206. * :class:`~django.db.models.FilePathField` now accepts a callable ``path``.
  207. * Allowed symmetrical intermediate table for self-referential
  208. :class:`~django.db.models.ManyToManyField`.
  209. * The ``name`` attributes of :class:`~django.db.models.CheckConstraint`,
  210. :class:`~django.db.models.UniqueConstraint`, and
  211. :class:`~django.db.models.Index` now support app label and class
  212. interpolation using the ``'%(app_label)s'`` and ``'%(class)s'`` placeholders.
  213. * The new :attr:`.Field.descriptor_class` attribute allows model fields to
  214. customize the get and set behavior by overriding their
  215. :py:ref:`descriptors <descriptors>`.
  216. * :class:`~django.db.models.Avg` and :class:`~django.db.models.Sum` now support
  217. the ``distinct`` argument.
  218. * Added :class:`~django.db.models.SmallAutoField` which acts much like an
  219. :class:`~django.db.models.AutoField` except that it only allows values under
  220. a certain (database-dependent) limit. Values from ``1`` to ``32767`` are safe
  221. in all databases supported by Django.
  222. * :class:`~django.db.models.AutoField`,
  223. :class:`~django.db.models.BigAutoField`, and
  224. :class:`~django.db.models.SmallAutoField` now inherit from
  225. ``IntegerField``, ``BigIntegerField`` and ``SmallIntegerField`` respectively.
  226. System checks and validators are now also properly inherited.
  227. * :attr:`.FileField.upload_to` now supports :class:`pathlib.Path`.
  228. Requests and Responses
  229. ~~~~~~~~~~~~~~~~~~~~~~
  230. * Allowed :class:`~django.http.HttpResponse` to be initialized with
  231. :class:`memoryview` content.
  232. * For use in, for example, Django templates, :attr:`.HttpRequest.headers` now
  233. allows look ups using underscores (e.g. ``user_agent``) in place of hyphens.
  234. Serialization
  235. ~~~~~~~~~~~~~
  236. * ...
  237. Signals
  238. ~~~~~~~
  239. * ...
  240. Templates
  241. ~~~~~~~~~
  242. * ...
  243. Tests
  244. ~~~~~
  245. * The new test :class:`~django.test.Client` argument
  246. ``raise_request_exception`` allows controlling whether or not exceptions
  247. raised during the request should also be raised in the test. The value
  248. defaults to ``True`` for backwards compatibility. If it is ``False`` and an
  249. exception occurs, the test client will return a 500 response with the
  250. attribute :attr:`~django.test.Response.exc_info`, a tuple providing
  251. information of the exception that occurred.
  252. * Tests and test cases to run can be selected by test name pattern using the
  253. new :option:`test -k` option.
  254. * HTML comparison, as used by
  255. :meth:`~django.test.SimpleTestCase.assertHTMLEqual`, now treats text, character
  256. references, and entity references that refer to the same character as
  257. equivalent.
  258. * Django test runner now supports headless mode for selenium tests on supported
  259. browsers. Add the ``--headless`` option to enable this mode.
  260. * Django test runner now supports ``--start-at`` and ``--start-after`` options
  261. to run tests starting from a specific top-level module.
  262. * Django test runner now supports a ``--pdb`` option to spawn a debugger at
  263. each error or failure.
  264. URLs
  265. ~~~~
  266. * ...
  267. Validators
  268. ~~~~~~~~~~
  269. * ...
  270. .. _backwards-incompatible-3.0:
  271. Backwards incompatible changes in 3.0
  272. =====================================
  273. Database backend API
  274. --------------------
  275. This section describes changes that may be needed in third-party database
  276. backends.
  277. * The second argument of ``DatabaseIntrospection.get_geometry_type()`` is now
  278. the row description instead of the column name.
  279. * ``DatabaseIntrospection.get_field_type()`` may no longer return tuples.
  280. * If the database can create foreign keys in the same SQL statement that adds a
  281. field, add ``SchemaEditor.sql_create_column_inline_fk`` with the appropriate
  282. SQL; otherwise, set ``DatabaseFeatures.can_create_inline_fk = False``.
  283. * ``DatabaseFeatures.can_return_id_from_insert`` and
  284. ``can_return_ids_from_bulk_insert`` are renamed to
  285. ``can_return_columns_from_insert`` and ``can_return_rows_from_bulk_insert``.
  286. * Database functions now handle :class:`datetime.timezone` formats when created
  287. using :class:`datetime.timedelta` instances (e.g.
  288. ``timezone(timedelta(hours=5))``, which would output ``'UTC+05:00'``).
  289. Third-party backends should handle this format when preparing
  290. :class:`~django.db.models.DateTimeField` in ``datetime_cast_date_sql()``,
  291. ``datetime_extract_sql()``, etc.
  292. * ``DatabaseOperations.return_insert_id()`` now requires an additional
  293. ``field`` argument with the model field.
  294. * Entries for ``AutoField``, ``BigAutoField``, and ``SmallAutoField`` are added
  295. to ``DatabaseOperations.integer_field_ranges`` to support the integer range
  296. validators on these field types. Third-party backends may need to customize
  297. the default entries.
  298. :mod:`django.contrib.admin`
  299. ---------------------------
  300. * Admin's model history change messages now prefers more readable field labels
  301. instead of field names.
  302. :mod:`django.contrib.gis`
  303. -------------------------
  304. * Support for PostGIS 2.1 is removed.
  305. * Support for SpatiaLite 4.1 and 4.2 is removed.
  306. * Support for GDAL 1.11 and GEOS 3.4 is removed.
  307. Dropped support for PostgreSQL 9.4
  308. ----------------------------------
  309. Upstream support for PostgreSQL 9.4 ends in December 2019. Django 3.0 supports
  310. PostgreSQL 9.5 and higher.
  311. Dropped support for Oracle 12.1
  312. -------------------------------
  313. Upstream support for Oracle 12.1 ends in July 2021. Django 2.2 will be
  314. supported until April 2022. Django 3.0 officially supports Oracle 12.2 and 18c.
  315. Removed private Python 2 compatibility APIs
  316. -------------------------------------------
  317. While Python 2 support was removed in Django 2.0, some private APIs weren't
  318. removed from Django so that third party apps could continue using them until
  319. the Python 2 end-of-life.
  320. Since we expect apps to drop Python 2 compatibility when adding support for
  321. Django 3.0, we're removing these APIs at this time.
  322. * ``django.test.utils.str_prefix()`` - Strings don't have 'u' prefixes in
  323. Python 3.
  324. * ``django.test.utils.patch_logger()`` - Use
  325. :meth:`unittest.TestCase.assertLogs` instead.
  326. * ``django.utils.lru_cache.lru_cache()`` - Alias of
  327. :func:`functools.lru_cache`.
  328. * ``django.utils.decorators.available_attrs()`` - This function returns
  329. ``functools.WRAPPER_ASSIGNMENTS``.
  330. * ``django.utils.decorators.ContextDecorator`` - Alias of
  331. :class:`contextlib.ContextDecorator`.
  332. * ``django.utils._os.abspathu()`` - Alias of :func:`os.path.abspath`.
  333. * ``django.utils._os.upath()`` and ``npath()`` - These functions do nothing on
  334. Python 3.
  335. * ``django.utils.six`` - Remove usage of this vendored library or switch to
  336. `six <https://pypi.org/project/six/>`_.
  337. * ``django.utils.encoding.python_2_unicode_compatible()`` - Alias of
  338. ``six.python_2_unicode_compatible()``.
  339. * ``django.utils.functional.curry()`` - Use :func:`functools.partial` or
  340. :class:`functools.partialmethod`. See :commit:`5b1c389603a353625ae1603`.
  341. * ``django.utils.safestring.SafeBytes`` - Unused since Django 2.0.
  342. New default value for the ``FILE_UPLOAD_PERMISSIONS`` setting
  343. -------------------------------------------------------------
  344. In older versions, the :setting:`FILE_UPLOAD_PERMISSIONS` setting defaults to
  345. ``None``. With the default :setting:`FILE_UPLOAD_HANDLERS`, this results in
  346. uploaded files having different permissions depending on their size and which
  347. upload handler is used.
  348. ``FILE_UPLOAD_PERMISSION`` now defaults to ``0o644`` to avoid this
  349. inconsistency.
  350. Miscellaneous
  351. -------------
  352. * ``ContentType.__str__()`` now includes the model's ``app_label`` to
  353. disambiguate model's with the same name in different apps.
  354. * Because accessing the language in the session rather than in the cookie is
  355. deprecated, ``LocaleMiddleware`` no longer looks for the user's language in
  356. the session and :func:`django.contrib.auth.logout` no longer preserves the
  357. session's language after logout.
  358. * :func:`django.utils.html.escape` now uses :func:`html.escape` to escape HTML.
  359. This converts ``'`` to ``&#x27;`` instead of the previous equivalent decimal
  360. code ``&#39;``.
  361. * The ``django-admin test -k`` option now works as the :option:`unittest
  362. -k<unittest.-k>` option rather than as a shortcut for ``--keepdb``.
  363. * Support for ``pywatchman`` < 1.2.0 is removed.
  364. * HTML rendered by :class:`~django.forms.SelectDateWidget` for required fields
  365. now have the ``placeholder`` attribute, which mainly may require some
  366. adjustments in tests that compare HTML.
  367. * :func:`~django.utils.http.urlencode` now encodes iterable values as they are
  368. when ``doseq=False``, rather than iterating them, bringing it into line with
  369. the standard library :func:`urllib.parse.urlencode` function.
  370. * ``intword`` template filter now translates ``1.0`` as a singular phrase and
  371. all other numeric values as plural. This may be incorrect for some languages.
  372. * Assigning a value to a model's :class:`~django.db.models.ForeignKey` or
  373. :class:`~django.db.models.OneToOneField` ``'_id'`` attribute now unsets the
  374. corresponding field. Accessing the field afterwards will result in a query.
  375. * :func:`~django.utils.cache.patch_vary_headers` now handles an asterisk
  376. ``'*'`` according to :rfc:`7231#section-7.1.4`, i.e. if a list of header
  377. field names contains an asterisk, then the ``Vary`` header will consist of a
  378. single asterisk ``'*'``.
  379. * :setting:`SECURE_CONTENT_TYPE_NOSNIFF` setting now defaults to ``True``. With
  380. the enabled :setting:`SECURE_CONTENT_TYPE_NOSNIFF`, the
  381. :class:`~django.middleware.security.SecurityMiddleware` sets the
  382. :ref:`x-content-type-options` header on all responses that do not already
  383. have it.
  384. .. _deprecated-features-3.0:
  385. Features deprecated in 3.0
  386. ==========================
  387. ``django.utils.encoding.force_text()`` and ``smart_text()``
  388. -----------------------------------------------------------
  389. The ``smart_text()`` and ``force_text()`` aliases (since Django 2.0) of
  390. ``smart_str()`` and ``force_str()`` are deprecated. Ignore this deprecation if
  391. your code supports Python 2 as the behavior of ``smart_str()`` and
  392. ``force_str()`` is different there.
  393. Miscellaneous
  394. -------------
  395. * ``django.utils.http.urlquote()``, ``urlquote_plus()``, ``urlunquote()``, and
  396. ``urlunquote_plus()`` are deprecated in favor of the functions that they're
  397. aliases for: :func:`urllib.parse.quote`, :func:`~urllib.parse.quote_plus`,
  398. :func:`~urllib.parse.unquote`, and :func:`~urllib.parse.unquote_plus`.
  399. * ``django.utils.translation.ugettext()``, ``ugettext_lazy()``,
  400. ``ugettext_noop()``, ``ungettext()``, and ``ungettext_lazy()`` are deprecated
  401. in favor of the functions that they're aliases for:
  402. :func:`django.utils.translation.gettext`,
  403. :func:`~django.utils.translation.gettext_lazy`,
  404. :func:`~django.utils.translation.gettext_noop`,
  405. :func:`~django.utils.translation.ngettext`, and
  406. :func:`~django.utils.translation.ngettext_lazy`.
  407. * To limit creation of sessions and hence favor some caching strategies,
  408. :func:`django.views.i18n.set_language` will stop setting the user's language
  409. in the session in Django 4.0. Since Django 2.1, the language is always stored
  410. in the :setting:`LANGUAGE_COOKIE_NAME` cookie.
  411. * ``alias=None`` is added to the signature of
  412. :meth:`.Expression.get_group_by_cols`.
  413. * ``django.utils.text.unescape_entities()`` is deprecated in favor of
  414. :func:`html.unescape`. Note that unlike ``unescape_entities()``,
  415. ``html.unescape()`` evaluates lazy strings immediately.
  416. .. _removed-features-3.0:
  417. Features removed in 3.0
  418. =======================
  419. These features have reached the end of their deprecation cycle and are removed
  420. in Django 3.0.
  421. See :ref:`deprecated-features-2.0` for details on these changes, including how
  422. to remove usage of these features.
  423. * The ``django.db.backends.postgresql_psycopg2`` module is removed.
  424. * ``django.shortcuts.render_to_response()`` is removed.
  425. * The ``DEFAULT_CONTENT_TYPE`` setting is removed.
  426. * ``HttpRequest.xreadlines()`` is removed.
  427. * Support for the ``context`` argument of ``Field.from_db_value()`` and
  428. ``Expression.convert_value()`` is removed.
  429. * The ``field_name`` keyword argument of ``QuerySet.earliest()`` and
  430. ``latest()`` is removed.
  431. See :ref:`deprecated-features-2.1` for details on these changes, including how
  432. to remove usage of these features.
  433. * The ``ForceRHR`` GIS function is removed.
  434. * ``django.utils.http.cookie_date()`` is removed.
  435. * The ``staticfiles`` and ``admin_static`` template tag libraries are removed.
  436. * ``django.contrib.staticfiles.templatetags.staticfiles.static()`` is removed.