1.9.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. :mod:`django.contrib.auth`
  28. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  29. * The default iteration count for the PBKDF2 password hasher has been increased
  30. by 20%. This backwards compatible change will not affect users who have
  31. subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
  32. default value.
  33. :mod:`django.contrib.gis`
  34. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  35. * ...
  36. :mod:`django.contrib.messages`
  37. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  38. * ...
  39. :mod:`django.contrib.redirects`
  40. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  41. * ...
  42. :mod:`django.contrib.sessions`
  43. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  44. * ...
  45. :mod:`django.contrib.sitemaps`
  46. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  47. * ...
  48. :mod:`django.contrib.sites`
  49. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  50. * ...
  51. :mod:`django.contrib.staticfiles`
  52. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  53. * ...
  54. :mod:`django.contrib.syndication`
  55. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  56. * ...
  57. Cache
  58. ^^^^^
  59. * ...
  60. Email
  61. ^^^^^
  62. * ...
  63. File Storage
  64. ^^^^^^^^^^^^
  65. * ...
  66. File Uploads
  67. ^^^^^^^^^^^^
  68. * ...
  69. Forms
  70. ^^^^^
  71. * :class:`~django.forms.ModelForm` accepts the new ``Meta`` option
  72. ``field_classes`` to customize the type of the fields. See
  73. :ref:`modelforms-overriding-default-fields` for details.
  74. Generic Views
  75. ^^^^^^^^^^^^^
  76. * Class based views generated using ``as_view()`` now have ``view_class``
  77. and ``view_initkwargs`` attributes.
  78. Internationalization
  79. ^^^^^^^^^^^^^^^^^^^^
  80. * ...
  81. Management Commands
  82. ^^^^^^^^^^^^^^^^^^^
  83. * ...
  84. Models
  85. ^^^^^^
  86. * Added the :meth:`RelatedManager.set()
  87. <django.db.models.fields.related.RelatedManager.set()>` method to the related
  88. managers created by ``ForeignKey``, ``GenericForeignKey``, and
  89. ``ManyToManyField``.
  90. Signals
  91. ^^^^^^^
  92. * ...
  93. Templates
  94. ^^^^^^^^^
  95. * Template tags created with the :meth:`~django.template.Library.simple_tag`
  96. helper can now store results in a template variable by using the ``as``
  97. argument.
  98. Requests and Responses
  99. ^^^^^^^^^^^^^^^^^^^^^^
  100. * ...
  101. Tests
  102. ^^^^^
  103. * ...
  104. Validators
  105. ^^^^^^^^^^
  106. * ...
  107. Backwards incompatible changes in 1.9
  108. =====================================
  109. .. warning::
  110. In addition to the changes outlined in this section, be sure to review the
  111. :doc:`deprecation timeline </internals/deprecation>` for any features that
  112. have been removed. If you haven't updated your code within the
  113. deprecation timeline for a given feature, its removal may appear as a
  114. backwards incompatible change.
  115. Database backend API
  116. ~~~~~~~~~~~~~~~~~~~~
  117. * A couple of new tests rely on the ability of the backend to introspect column
  118. defaults (returning the result as ``Field.default``). You can set the
  119. ``can_introspect_default`` database feature to ``False`` if your backend
  120. doesn't implement this. You may want to review the implementation on the
  121. backends that Django includes for reference (:ticket:`24245`).
  122. Default settings that were tuples are now lists
  123. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. The default settings in ``django.conf.global_settings`` were a combination of
  125. lists and tuples. All settings that were formerly tuples are now lists.
  126. ``is_usable`` attribute on template loaders is removed
  127. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128. Django template loaders previously required an ``is_usable`` attribute to be
  129. defined. If a loader was configured in the template settings and this attribute
  130. was ``False``, the loader would be silently ignored. In practice, this was only
  131. used by the egg loader to detect if setuptools was installed. The ``is_usable``
  132. attribute is now removed and the egg loader instead fails at runtime if
  133. setuptools is not installed.
  134. Related set direct assignment
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. :ref:`Direct assignment <direct-assignment>`) used to perform a ``clear()``
  137. followed by a call to ``add()``. This caused needlessly large data changes
  138. and prevented using the :data:`~django.db.models.signals.m2m_changed` signal
  139. to track individual changes in many-to-many relations.
  140. Direct assignment now relies on the the new
  141. :meth:`django.db.models.fields.related.RelatedManager.set()` method on
  142. related managers which by default only processes changes between the
  143. existing related set and the one that's newly assigned. The previous behavior
  144. can be restored by replacing direct assignment by a call to ``set()`` with
  145. the keyword argument ``clear=True``.
  146. ``ModelForm``, and therefore ``ModelAdmin``, internally rely on direct
  147. assignment for many-to-many relations and as a consequence now use the new
  148. behavior.
  149. Miscellaneous
  150. ~~~~~~~~~~~~~
  151. * CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have
  152. been removed as these browsers have reached end-of-life.
  153. * ``django.http.responses.REASON_PHRASES`` and
  154. ``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use
  155. Python's stdlib instead: :data:`http.client.responses` for Python 3 and
  156. `httplib.responses`_ for Python 2.
  157. .. _`httplib.responses`: https://docs.python.org/2/library/httplib.html#httplib.responses
  158. * ``ValuesQuerySet`` and ``ValuesListQuerySet`` have been removed.
  159. .. _deprecated-features-1.9:
  160. Features deprecated in 1.9
  161. ==========================
  162. ``assignment_tag()``
  163. ~~~~~~~~~~~~~~~~~~~~
  164. Django 1.4 added the ``assignment_tag`` helper to ease the creation of
  165. template tags that store results in a template variable. The
  166. :meth:`~django.template.Library.simple_tag` helper has gained this same
  167. ability, making the ``assignment_tag`` obsolete. Tags that use
  168. ``assignment_tag`` should be updated to use ``simple_tag``.
  169. Miscellaneous
  170. ~~~~~~~~~~~~~
  171. * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has
  172. been deprecated as it has no effect.
  173. * The ``check_aggregate_support()`` method of
  174. ``django.db.backends.base.BaseDatabaseOperations`` has been deprecated and
  175. will be removed in Django 2.1. The more general ``check_expression_support()``
  176. should be used instead.
  177. * ``django.forms.extras`` is deprecated. You can find
  178. :class:`~django.forms.SelectDateWidget` in ``django.forms.widgets``
  179. (or simply ``django.forms``) instead.
  180. .. removed-features-1.9:
  181. Features removed in 1.9
  182. =======================
  183. These features have reached the end of their deprecation cycle and so have been
  184. removed in Django 1.9 (please see the :ref:`deprecation timeline
  185. <deprecation-removed-in-1.9>` for more details):
  186. * ``django.utils.dictconfig`` is removed.
  187. * ``django.utils.importlib`` is removed.
  188. * ``django.utils.tzinfo`` is removed.
  189. * ``django.utils.unittest`` is removed.
  190. * The ``syncdb`` command is removed.
  191. * ``django.db.models.signals.pre_syncdb`` and
  192. ``django.db.models.signals.post_syncdb`` is removed.
  193. * Support for ``allow_syncdb`` on database routers is removed.
  194. * The legacy method of syncing apps without migrations is removed,
  195. and migrations are compulsory for all apps. This includes automatic
  196. loading of ``initial_data`` fixtures and support for initial SQL data.
  197. * All models need to be defined inside an installed application or declare an
  198. explicit :attr:`~django.db.models.Options.app_label`. Furthermore, it isn't
  199. possible to import them before their application is loaded. In particular, it
  200. isn't possible to import models inside the root package of an application.
  201. * The model and form ``IPAddressField`` is removed. A stub field remains for
  202. compatibility with historical migrations.
  203. * ``AppCommand.handle_app()`` is no longer be supported.
  204. * ``RequestSite`` and ``get_current_site()`` are no longer importable from
  205. ``django.contrib.sites.models``.
  206. * FastCGI support via the ``runfcgi`` management command is removed.
  207. * ``django.utils.datastructures.SortedDict`` is removed.
  208. * ``ModelAdmin.declared_fieldsets`` is removed.
  209. * The ``util`` modules that provided backwards compatibility are removed:
  210. * ``django.contrib.admin.util``
  211. * ``django.contrib.gis.db.backends.util``
  212. * ``django.db.backends.util``
  213. * ``django.forms.util``
  214. * ``ModelAdmin.get_formsets`` is removed.
  215. * The backward compatible shims introduced to rename the
  216. ``BaseMemcachedCache._get_memcache_timeout()`` method to
  217. ``get_backend_timeout()`` is removed.
  218. * The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` are removed.
  219. * The ``use_natural_keys`` argument for ``serializers.serialize()`` is removed.
  220. * Private API ``django.forms.forms.get_declared_fields()`` is removed.
  221. * The ability to use a ``SplitDateTimeWidget`` with ``DateTimeField`` is
  222. removed.
  223. * The ``WSGIRequest.REQUEST`` property is removed.
  224. * The class ``django.utils.datastructures.MergeDict`` is removed.
  225. * The ``zh-cn`` and ``zh-tw`` language codes are removed.
  226. * The internal ``django.utils.functional.memoize()`` is removed.
  227. * ``django.core.cache.get_cache`` is removed.
  228. * ``django.db.models.loading`` is removed.
  229. * Passing callable arguments to querysets is no longer possible.
  230. * ``BaseCommand.requires_model_validation`` is removed in favor of
  231. ``requires_system_checks``. Admin validators is replaced by admin checks.
  232. * The ``ModelAdmin.validator_class`` and ``default_validator_class`` attributes
  233. are removed.
  234. * ``ModelAdmin.validate()`` is removed.
  235. * ``django.db.backends.DatabaseValidation.validate_field`` is removed in
  236. favor of the ``check_field`` method.
  237. * The ``check`` management command is removed.
  238. * ``django.utils.module_loading.import_by_path`` is removed in favor of
  239. ``django.utils.module_loading.import_string``.
  240. * ``ssi`` and ``url`` template tags are removed from the ``future`` template
  241. tag library.
  242. * ``django.utils.text.javascript_quote()`` is removed.
  243. * Database test settings as independent entries in the database settings,
  244. prefixed by ``TEST_``, are no longer supported.
  245. * The `cache_choices` option to :class:`~django.forms.ModelChoiceField` and
  246. :class:`~django.forms.ModelMultipleChoiceField` is removed.
  247. * The default value of the
  248. :attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
  249. attribute has changed from ``True`` to ``False``.
  250. * ``django.contrib.sitemaps.FlatPageSitemap`` is removed in favor of
  251. ``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
  252. * Private API ``django.test.utils.TestTemplateLoader`` is removed.
  253. * The ``django.contrib.contenttypes.generic`` module is removed.