1.9.txt 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. ============================================
  2. Django 1.9 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. Welcome to Django 1.9!
  5. These release notes cover the `new features`_, as well as some `backwards
  6. incompatible changes`_ you'll want to be aware of when upgrading from Django
  7. 1.8 or older versions. We've :ref:`dropped some features
  8. <deprecation-removed-in-1.9>` that have reached the end of their deprecation
  9. cycle, and we've `begun the deprecation process for some features`_.
  10. .. _`new features`: `What's new in Django 1.9`_
  11. .. _`backwards incompatible changes`: `Backwards incompatible changes in 1.9`_
  12. .. _`dropped some features`: `Features removed in 1.9`_
  13. .. _`begun the deprecation process for some features`: `Features deprecated in 1.9`_
  14. Python compatibility
  15. ====================
  16. Like Django 1.8, Django 1.9 requires Python 2.7 or above, though we
  17. **highly recommend** the latest minor release. We've dropped support for
  18. Python 3.2 and added support for Python 3.5.
  19. What's new in Django 1.9
  20. ========================
  21. ...
  22. Minor features
  23. ~~~~~~~~~~~~~~
  24. :mod:`django.contrib.admin`
  25. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  26. * Admin views now have ``model_admin`` or ``admin_site`` attributes.
  27. * The URL of the admin change view has been changed (was at
  28. ``/admin/<app>/<model>/<pk>/`` by default and is now at
  29. ``/admin/<app>/<model>/<pk>/change/``). This should not affect your
  30. application unless you have hardcoded admin URLs. In that case, replace those
  31. links by :ref:`reversing admin URLs <admin-reverse-urls>` instead. Note that
  32. the old URL still redirects to the new one for backwards compatibility, but
  33. it may be removed in a future version.
  34. * :meth:`ModelAdmin.get_list_select_related()
  35. <django.contrib.admin.ModelAdmin.get_list_select_related>` was added to allow
  36. changing the ``select_related()`` values used in the admin's changelist query
  37. based on the request.
  38. * The ``available_apps`` context variable, which lists the available
  39. applications for the current user, has been added to the
  40. :meth:`AdminSite.each_context() <django.contrib.admin.AdminSite.each_context>`
  41. method.
  42. :mod:`django.contrib.auth`
  43. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  44. * The default iteration count for the PBKDF2 password hasher has been increased
  45. by 20%. This backwards compatible change will not affect users who have
  46. subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
  47. default value.
  48. * The ``BCryptSHA256PasswordHasher`` will now update passwords if its
  49. ``rounds`` attribute is changed.
  50. * ``AbstractBaseUser`` and ``BaseUserManager`` were moved to a new
  51. ``django.contrib.auth.base_user`` module so that they can be imported without
  52. including ``django.contrib.auth`` in :setting:`INSTALLED_APPS` (this raised
  53. a deprecation warning in older versions and is no longer supported in
  54. Django 1.9).
  55. :mod:`django.contrib.gis`
  56. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  57. * All ``GeoQuerySet`` methods have been deprecated and replaced by
  58. :doc:`equivalent database functions </ref/contrib/gis/functions>`. As soon
  59. as the legacy methods have been replaced in your code, you should even be
  60. able to remove the special ``GeoManager`` from your GIS-enabled classes.
  61. * The GDAL interface now supports instantiating file-based and in-memory
  62. :ref:`GDALRaster objects <raster-data-source-objects>` from raw data.
  63. Setters for raster properties such as projection or pixel values have
  64. been added.
  65. :mod:`django.contrib.messages`
  66. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  67. * ...
  68. :mod:`django.contrib.postgres`
  69. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  70. * Added :doc:`/ref/contrib/postgres/aggregates`.
  71. :mod:`django.contrib.redirects`
  72. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  73. * ...
  74. :mod:`django.contrib.sessions`
  75. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  76. * ...
  77. :mod:`django.contrib.sitemaps`
  78. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  79. * ...
  80. :mod:`django.contrib.sites`
  81. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  82. * ...
  83. :mod:`django.contrib.staticfiles`
  84. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  85. * ...
  86. :mod:`django.contrib.syndication`
  87. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  88. * ...
  89. Cache
  90. ^^^^^
  91. * ``django.core.cache.backends.base.BaseCache`` now has a ``get_or_set()``
  92. method.
  93. * :func:`django.views.decorators.cache.never_cache` now sends more persuasive
  94. headers (added ``no-cache, no-store, must-revalidate`` to ``Cache-Control``)
  95. to better prevent caching.
  96. Email
  97. ^^^^^
  98. * ...
  99. File Storage
  100. ^^^^^^^^^^^^
  101. * ...
  102. File Uploads
  103. ^^^^^^^^^^^^
  104. * ...
  105. Forms
  106. ^^^^^
  107. * :class:`~django.forms.ModelForm` accepts the new ``Meta`` option
  108. ``field_classes`` to customize the type of the fields. See
  109. :ref:`modelforms-overriding-default-fields` for details.
  110. * You can now specify the order in which form fields are rendered with the
  111. :attr:`~django.forms.Form.field_order` attribute, the ``field_order``
  112. constructor argument , or the :meth:`~django.forms.Form.order_fields` method.
  113. Generic Views
  114. ^^^^^^^^^^^^^
  115. * Class based views generated using ``as_view()`` now have ``view_class``
  116. and ``view_initkwargs`` attributes.
  117. Internationalization
  118. ^^^^^^^^^^^^^^^^^^^^
  119. * The :func:`django.views.i18n.set_language` view now properly redirects to
  120. :ref:`translated URLs <url-internationalization>`, when available.
  121. * The :func:`django.views.i18n.javascript_catalog` view now works correctly
  122. if used multiple times with different configurations on the same page.
  123. * The :func:`django.utils.timezone.make_aware` function gained an ``is_dst``
  124. argument to help resolve ambiguous times during DST transitions.
  125. * You can now use locale variants supported by gettext. These are usually used
  126. for languages which can be written in different scripts, for example Latin
  127. and Cyrillic (e.g. ``be@latin``).
  128. Management Commands
  129. ^^^^^^^^^^^^^^^^^^^
  130. * The new :djadmin:`sendtestemail` command lets you send a test email to
  131. easily confirm that email sending through Django is working.
  132. * To increase the readability of the SQL code generated by
  133. :djadmin:`sqlmigrate`, the SQL code generated for each migration operation is
  134. preceded by the operation's description.
  135. * The :djadmin:`dumpdata` command output is now deterministically ordered.
  136. * The :djadmin:`createcachetable` command now has a ``--dry-run`` flag to
  137. print out the SQL rather than execute it.
  138. Models
  139. ^^^^^^
  140. * Added the :meth:`RelatedManager.set()
  141. <django.db.models.fields.related.RelatedManager.set()>` method to the related
  142. managers created by ``ForeignKey``, ``GenericForeignKey``, and
  143. ``ManyToManyField``.
  144. * Added the ``keep_parents`` parameter to :meth:`Model.delete()
  145. <django.db.models.Model.delete>` to allow deleting only a child's data in a
  146. model that uses multi-table inheritance.
  147. * Added a system check to prevent defining both ``Meta.ordering`` and
  148. ``order_with_respect_to`` on the same model.
  149. * :lookup:`Date and time <year>` lookups can be chained with other lookups
  150. (such as :lookup:`exact`, :lookup:`gt`, :lookup:`lt`, etc.). For example:
  151. ``Entry.objects.filter(pub_date__month__gt=6)``.
  152. * You can specify the ``output_field`` parameter of the
  153. :class:`~django.db.models.Avg` aggregate in order to aggregate over
  154. non-numeric columns, such as ``DurationField``.
  155. CSRF
  156. ^^^^
  157. * The request header's name used for CSRF authentication can be customized
  158. with :setting:`CSRF_HEADER_NAME`.
  159. Signals
  160. ^^^^^^^
  161. * ...
  162. Templates
  163. ^^^^^^^^^
  164. * Template tags created with the :meth:`~django.template.Library.simple_tag`
  165. helper can now store results in a template variable by using the ``as``
  166. argument.
  167. * Added a :meth:`Context.setdefault() <django.template.Context.setdefault>`
  168. method.
  169. * A warning will now be logged for missing context variables. These messages
  170. will be logged to the :ref:`django.template <django-template-logger>` logger.
  171. * The :ttag:`firstof` template tag supports storing the output in a variable
  172. using 'as'.
  173. * :meth:`Context.update() <django.template.Context.update>` can now be used as
  174. a context manager.
  175. * Django template loaders can now extend templates recursively.
  176. * The debug page template postmortem now include output from each engine that
  177. is installed.
  178. * :ref:`Debug page integration <template-debug-integration>` for custom
  179. template engines was added.
  180. Requests and Responses
  181. ^^^^^^^^^^^^^^^^^^^^^^
  182. * Unless :attr:`HttpResponse.reason_phrase
  183. <django.http.HttpResponse.reason_phrase>` is explicitly set, it now is
  184. determined by the current value of :attr:`HttpResponse.status_code
  185. <django.http.HttpResponse.status_code>`. Modifying the value of
  186. ``status_code`` outside of the constructor will also modify the value of
  187. ``reason_phrase``.
  188. * The debug view now shows details of chained exceptions on Python 3.
  189. * The default 40x error views now accept a second positional parameter, the
  190. exception that triggered the view.
  191. Tests
  192. ^^^^^
  193. * ...
  194. URLs
  195. ^^^^
  196. * Regular expression lookaround assertions are now allowed in URL patterns.
  197. Validators
  198. ^^^^^^^^^^
  199. * Added :func:`django.core.validators.int_list_validator` to generate
  200. validators of strings containing integers separated with a custom character.
  201. * :class:`~django.core.validators.EmailValidator` now limits the length of
  202. domain name labels to 63 characters per :rfc:`1034`.
  203. Backwards incompatible changes in 1.9
  204. =====================================
  205. .. warning::
  206. In addition to the changes outlined in this section, be sure to review the
  207. :doc:`deprecation timeline </internals/deprecation>` for any features that
  208. have been removed. If you haven't updated your code within the
  209. deprecation timeline for a given feature, its removal may appear as a
  210. backwards incompatible change.
  211. Database backend API
  212. ~~~~~~~~~~~~~~~~~~~~
  213. * A couple of new tests rely on the ability of the backend to introspect column
  214. defaults (returning the result as ``Field.default``). You can set the
  215. ``can_introspect_default`` database feature to ``False`` if your backend
  216. doesn't implement this. You may want to review the implementation on the
  217. backends that Django includes for reference (:ticket:`24245`).
  218. Default settings that were tuples are now lists
  219. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220. The default settings in ``django.conf.global_settings`` were a combination of
  221. lists and tuples. All settings that were formerly tuples are now lists.
  222. ``is_usable`` attribute on template loaders is removed
  223. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224. Django template loaders previously required an ``is_usable`` attribute to be
  225. defined. If a loader was configured in the template settings and this attribute
  226. was ``False``, the loader would be silently ignored. In practice, this was only
  227. used by the egg loader to detect if setuptools was installed. The ``is_usable``
  228. attribute is now removed and the egg loader instead fails at runtime if
  229. setuptools is not installed.
  230. Related set direct assignment
  231. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  232. :ref:`Direct assignment <direct-assignment>`) used to perform a ``clear()``
  233. followed by a call to ``add()``. This caused needlessly large data changes
  234. and prevented using the :data:`~django.db.models.signals.m2m_changed` signal
  235. to track individual changes in many-to-many relations.
  236. Direct assignment now relies on the the new
  237. :meth:`django.db.models.fields.related.RelatedManager.set()` method on
  238. related managers which by default only processes changes between the
  239. existing related set and the one that's newly assigned. The previous behavior
  240. can be restored by replacing direct assignment by a call to ``set()`` with
  241. the keyword argument ``clear=True``.
  242. ``ModelForm``, and therefore ``ModelAdmin``, internally rely on direct
  243. assignment for many-to-many relations and as a consequence now use the new
  244. behavior.
  245. Filesystem-based template loaders catch more specific exceptions
  246. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247. When using the :class:`filesystem.Loader <django.template.loaders.filesystem.Loader>`
  248. or :class:`app_directories.Loader <django.template.loaders.app_directories.Loader>`
  249. template loaders, earlier versions of Django raised a
  250. :exc:`~django.template.TemplateDoesNotExist` error if a template source existed
  251. but was unreadable. This could happen under many circumstances, such as if
  252. Django didn't have permissions to open the file, or if the template source was
  253. a directory. Now, Django only silences the exception if the template source
  254. does not exist. All other situations result in the original ``IOError`` being
  255. raised.
  256. HTTP redirects no longer forced to absolute URIs
  257. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. Relative redirects are no longer converted to absolute URIs. :rfc:`2616`
  259. required the ``Location`` header in redirect responses to be an absolute URI,
  260. but it has been superseded by :rfc:`7231` which allows relative URIs in
  261. ``Location``, recognizing the actual practice of user agents, almost all of
  262. which support them.
  263. Consequently, the expected URLs passed to ``assertRedirects`` should generally
  264. no longer include the scheme and domain part of the URLs. For example,
  265. ``self.assertRedirects(response, 'http://testserver/some-url/')`` should be
  266. replaced by ``self.assertRedirects(response, '/some-url/')`` (unless the
  267. redirection specifically contained an absolute URL, of course).
  268. Dropped support for PostgreSQL 9.0
  269. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  270. Upstream support for PostgreSQL 9.0 ended in September 2015. As a consequence,
  271. Django 1.9 sets 9.1 as the minimum PostgreSQL version it officially supports.
  272. Template ``LoaderOrigin`` and ``StringOrigin`` are removed
  273. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274. In previous versions of Django, when a template engine was initialized with
  275. debug as ``True``, an instance of ``django.template.loader.LoaderOrigin`` or
  276. ``django.template.base.StringOrigin`` was set as the origin attribute on the
  277. template object. These classes have been combined into
  278. :class:`~django.template.base.Origin` and is now always set regardless of the
  279. engine debug setting.
  280. .. _default-logging-changes-19:
  281. Changes to the default logging configuration
  282. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. To make it easier to write custom logging configurations, Django's default
  284. logging configuration no longer defines 'django.request' and 'django.security'
  285. loggers. Instead, it defines a single 'django' logger with two handlers:
  286. * 'console': filtered at the ``INFO`` level and only active if ``DEBUG=True``.
  287. * 'mail_admins': filtered at the ``ERROR`` level and only active if
  288. ``DEBUG=False``.
  289. If you aren't overriding Django's default logging, you should see minimal
  290. changes in behavior, but you might see some new logging to the ``runserver``
  291. console, for example.
  292. If you are overriding Django's default logging, you should check to see how
  293. your configuration merges with the new defaults.
  294. Miscellaneous
  295. ~~~~~~~~~~~~~
  296. * CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have
  297. been removed as these browsers have reached end-of-life.
  298. * The text displayed for null columns in the admin changelist ``list_display``
  299. cells has changed from ``(None)`` (or its translated equivalent) to ``-``.
  300. * ``django.http.responses.REASON_PHRASES`` and
  301. ``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use
  302. Python's stdlib instead: :data:`http.client.responses` for Python 3 and
  303. `httplib.responses`_ for Python 2.
  304. .. _`httplib.responses`: https://docs.python.org/2/library/httplib.html#httplib.responses
  305. * ``ValuesQuerySet`` and ``ValuesListQuerySet`` have been removed.
  306. * The ``admin/base.html`` template no longer sets
  307. ``window.__admin_media_prefix__``. Image references in JavaScript that used
  308. that value to construct absolute URLs have been moved to CSS for easier
  309. customization.
  310. * ``CommaSeparatedIntegerField`` validation has been refined to forbid values
  311. like ``','``, ``',1'``, and ``'1,,2'``.
  312. * Form initialization was moved from the :meth:`ProcessFormView.get()
  313. <django.views.generic.edit.ProcessFormView.get>` method to the new
  314. :meth:`FormMixin.get_context_data()
  315. <django.views.generic.edit.FormMixin.get_context_data>` method. This may be
  316. backwards incompatible if you have overridden the ``get_context_data()``
  317. method without calling ``super()``.
  318. * Support for PostGIS 1.5 has been dropped.
  319. .. _deprecated-features-1.9:
  320. Features deprecated in 1.9
  321. ==========================
  322. ``assignment_tag()``
  323. ~~~~~~~~~~~~~~~~~~~~
  324. Django 1.4 added the ``assignment_tag`` helper to ease the creation of
  325. template tags that store results in a template variable. The
  326. :meth:`~django.template.Library.simple_tag` helper has gained this same
  327. ability, making the ``assignment_tag`` obsolete. Tags that use
  328. ``assignment_tag`` should be updated to use ``simple_tag``.
  329. ``{% cycle %}`` syntax with comma-separated arguments
  330. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  331. The :ttag:`cycle` tag supports an inferior old syntax from previous Django
  332. versions:
  333. .. code-block:: html+django
  334. {% cycle row1,row2,row3 %}
  335. Its parsing caused bugs with the current syntax, so support for the old syntax
  336. will be removed in Django 2.0 following an accelerated deprecation.
  337. ``Field.rel`` changes
  338. ~~~~~~~~~~~~~~~~~~~~~
  339. ``Field.rel`` and its methods and attributes have changed to match the related
  340. fields API. The ``Field.rel`` attribute is renamed to ``remote_field`` and many
  341. of its methods and attributes are either changed or renamed.
  342. The aim of these changes is to provide a documented API for relation fields.
  343. ``GeoManager`` and ``GeoQuerySet`` custom methods
  344. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  345. All custom ``GeoQuerySet`` methods (``area()``, ``distance()``, ``gml()``, ...)
  346. have been replaced by equivalent geographic expressions in annotations (see in
  347. new features). Hence the need to set a custom ``GeoManager`` to GIS-enabled
  348. models is now obsolete. As soon as your code doesn't call any of the deprecated
  349. methods, you can simply remove the ``objects = GeoManager()`` lines from your
  350. models.
  351. Template loader APIs have changed
  352. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  353. Django template loaders have been updated to allow recursive template
  354. extending. This change necessitated a new template loader API. The old
  355. ``load_template()`` and ``load_template_sources()`` methods are now deprecated.
  356. Details about the new API can be found :ref:`in the template loader
  357. documentation <custom-template-loaders>`.
  358. Miscellaneous
  359. ~~~~~~~~~~~~~
  360. * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has
  361. been deprecated as it has no effect.
  362. * The ``check_aggregate_support()`` method of
  363. ``django.db.backends.base.BaseDatabaseOperations`` has been deprecated and
  364. will be removed in Django 2.1. The more general ``check_expression_support()``
  365. should be used instead.
  366. * ``django.forms.extras`` is deprecated. You can find
  367. :class:`~django.forms.SelectDateWidget` in ``django.forms.widgets``
  368. (or simply ``django.forms``) instead.
  369. * Private API ``django.db.models.fields.add_lazy_relation()`` is deprecated.
  370. * The ``django.contrib.auth.tests.utils.skipIfCustomUser()`` decorator is
  371. deprecated. With the test discovery changes in Django 1.6, the tests for
  372. ``django.contrib`` apps are no longer run as part of the user's project.
  373. Therefore, the ``@skipIfCustomUser`` decorator is no longer needed to
  374. decorate tests in ``django.contrib.auth``.
  375. * If you customized some :ref:`error handlers <error-views>`, the view
  376. signatures with only one request parameter are deprecated. The views should
  377. now also accept a second ``exception`` positional parameter.
  378. .. removed-features-1.9:
  379. Features removed in 1.9
  380. =======================
  381. These features have reached the end of their deprecation cycle and so have been
  382. removed in Django 1.9 (please see the :ref:`deprecation timeline
  383. <deprecation-removed-in-1.9>` for more details):
  384. * ``django.utils.dictconfig`` is removed.
  385. * ``django.utils.importlib`` is removed.
  386. * ``django.utils.tzinfo`` is removed.
  387. * ``django.utils.unittest`` is removed.
  388. * The ``syncdb`` command is removed.
  389. * ``django.db.models.signals.pre_syncdb`` and
  390. ``django.db.models.signals.post_syncdb`` is removed.
  391. * Support for ``allow_syncdb`` on database routers is removed.
  392. * The legacy method of syncing apps without migrations is removed,
  393. and migrations are compulsory for all apps. This includes automatic
  394. loading of ``initial_data`` fixtures and support for initial SQL data.
  395. * All models need to be defined inside an installed application or declare an
  396. explicit :attr:`~django.db.models.Options.app_label`. Furthermore, it isn't
  397. possible to import them before their application is loaded. In particular, it
  398. isn't possible to import models inside the root package of an application.
  399. * The model and form ``IPAddressField`` is removed. A stub field remains for
  400. compatibility with historical migrations.
  401. * ``AppCommand.handle_app()`` is no longer be supported.
  402. * ``RequestSite`` and ``get_current_site()`` are no longer importable from
  403. ``django.contrib.sites.models``.
  404. * FastCGI support via the ``runfcgi`` management command is removed.
  405. * ``django.utils.datastructures.SortedDict`` is removed.
  406. * ``ModelAdmin.declared_fieldsets`` is removed.
  407. * The ``util`` modules that provided backwards compatibility are removed:
  408. * ``django.contrib.admin.util``
  409. * ``django.contrib.gis.db.backends.util``
  410. * ``django.db.backends.util``
  411. * ``django.forms.util``
  412. * ``ModelAdmin.get_formsets`` is removed.
  413. * The backward compatible shims introduced to rename the
  414. ``BaseMemcachedCache._get_memcache_timeout()`` method to
  415. ``get_backend_timeout()`` is removed.
  416. * The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` are removed.
  417. * The ``use_natural_keys`` argument for ``serializers.serialize()`` is removed.
  418. * Private API ``django.forms.forms.get_declared_fields()`` is removed.
  419. * The ability to use a ``SplitDateTimeWidget`` with ``DateTimeField`` is
  420. removed.
  421. * The ``WSGIRequest.REQUEST`` property is removed.
  422. * The class ``django.utils.datastructures.MergeDict`` is removed.
  423. * The ``zh-cn`` and ``zh-tw`` language codes are removed.
  424. * The internal ``django.utils.functional.memoize()`` is removed.
  425. * ``django.core.cache.get_cache`` is removed.
  426. * ``django.db.models.loading`` is removed.
  427. * Passing callable arguments to querysets is no longer possible.
  428. * ``BaseCommand.requires_model_validation`` is removed in favor of
  429. ``requires_system_checks``. Admin validators is replaced by admin checks.
  430. * The ``ModelAdmin.validator_class`` and ``default_validator_class`` attributes
  431. are removed.
  432. * ``ModelAdmin.validate()`` is removed.
  433. * ``django.db.backends.DatabaseValidation.validate_field`` is removed in
  434. favor of the ``check_field`` method.
  435. * The ``validate`` management command is removed.
  436. * ``django.utils.module_loading.import_by_path`` is removed in favor of
  437. ``django.utils.module_loading.import_string``.
  438. * ``ssi`` and ``url`` template tags are removed from the ``future`` template
  439. tag library.
  440. * ``django.utils.text.javascript_quote()`` is removed.
  441. * Database test settings as independent entries in the database settings,
  442. prefixed by ``TEST_``, are no longer supported.
  443. * The `cache_choices` option to :class:`~django.forms.ModelChoiceField` and
  444. :class:`~django.forms.ModelMultipleChoiceField` is removed.
  445. * The default value of the
  446. :attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
  447. attribute has changed from ``True`` to ``False``.
  448. * ``django.contrib.sitemaps.FlatPageSitemap`` is removed in favor of
  449. ``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
  450. * Private API ``django.test.utils.TestTemplateLoader`` is removed.
  451. * The ``django.contrib.contenttypes.generic`` module is removed.