1.11.txt 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. =============================================
  2. Django 1.11 release notes - UNDER DEVELOPMENT
  3. =============================================
  4. Welcome to Django 1.11!
  5. These release notes cover the :ref:`new features <whats-new-1.11>`, as well as
  6. some :ref:`backwards incompatible changes <backwards-incompatible-1.11>` you'll
  7. want to be aware of when upgrading from Django 1.10 or older versions. We've
  8. :ref:`begun the deprecation process for some features
  9. <deprecated-features-1.11>`.
  10. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  11. project.
  12. Django 1.11 is designated as a :term:`long-term support release`. It will
  13. receive security updates for at least three years after its release. Support
  14. for the previous LTS, Django 1.8, will end 6 months after the release date of
  15. Django 1.11.
  16. Python compatibility
  17. ====================
  18. Like Django 1.10, Django 1.11 requires Python 2.7, 3.4, or 3.5. We **highly
  19. recommend** and only officially support the latest release of each series.
  20. The Django 1.11.x series is the last to support Python 2. The next major
  21. release, Django 2.0, will only support Python 3.5+.
  22. Deprecating warnings are no longer loud by default
  23. ==================================================
  24. Unlike older versions of Django, Django's own deprecation warnings are no
  25. longer displayed by default. This is consistent with Python's default behavior.
  26. This change allows third-party apps to support both Django 1.11 LTS and Django
  27. 1.8 LTS without having to add code to avoid deprecation warnings.
  28. Following the release of Django 2.0, we suggest that third-party app authors
  29. drop support for all versions of Django prior to 1.11. At that time, you should
  30. be able run your package's tests using ``python -Wd`` so that deprecation
  31. warnings do appear. After making the deprecation warning fixes, your app should
  32. be compatible with Django 2.0.
  33. .. _whats-new-1.11:
  34. What's new in Django 1.11
  35. =========================
  36. Minor features
  37. --------------
  38. :mod:`django.contrib.admin`
  39. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. * :attr:`.ModelAdmin.date_hierarchy` can now reference fields across relations.
  41. :mod:`django.contrib.admindocs`
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. * ...
  44. :mod:`django.contrib.auth`
  45. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  46. * The default iteration count for the PBKDF2 password hasher is increased by
  47. 20%.
  48. * The :class:`~django.contrib.auth.views.LoginView` and
  49. :class:`~django.contrib.auth.views.LogoutView` class-based views supersede the
  50. deprecated ``login()`` and ``logout()`` function-based views.
  51. :mod:`django.contrib.contenttypes`
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. * ...
  54. :mod:`django.contrib.gis`
  55. ~~~~~~~~~~~~~~~~~~~~~~~~~
  56. * The new :meth:`.GEOSGeometry.from_gml` and :meth:`.OGRGeometry.from_gml`
  57. methods allow creating geometries from GML.
  58. :mod:`django.contrib.messages`
  59. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. * ...
  61. :mod:`django.contrib.postgres`
  62. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. * The new ``distinct`` argument for
  64. :class:`~django.contrib.postgres.aggregates.StringAgg` determines if
  65. concatenated values will be distinct.
  66. :mod:`django.contrib.redirects`
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. * ...
  69. :mod:`django.contrib.sessions`
  70. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  71. * ...
  72. :mod:`django.contrib.sitemaps`
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. * ...
  75. :mod:`django.contrib.sites`
  76. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  77. * ...
  78. :mod:`django.contrib.staticfiles`
  79. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. * ...
  81. :mod:`django.contrib.syndication`
  82. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. * ...
  84. Cache
  85. ~~~~~
  86. * ...
  87. CSRF
  88. ~~~~
  89. * ...
  90. Database backends
  91. ~~~~~~~~~~~~~~~~~
  92. * ...
  93. Email
  94. ~~~~~
  95. * Added the :setting:`EMAIL_USE_LOCALTIME` setting to allow sending SMTP date
  96. headers in the local time zone rather than in UTC.
  97. File Storage
  98. ~~~~~~~~~~~~
  99. * To make it wrappable by :class:`io.TextIOWrapper`,
  100. :class:`~django.core.files.File` now has the ``readable()``, ``writable()``,
  101. and ``seekable()`` methods.
  102. File Uploads
  103. ~~~~~~~~~~~~
  104. * ...
  105. Forms
  106. ~~~~~
  107. * The new :attr:`CharField.empty_value <django.forms.CharField.empty_value>`
  108. attribute allows specifying the Python value to use to represent "empty".
  109. Generic Views
  110. ~~~~~~~~~~~~~
  111. * ...
  112. Internationalization
  113. ~~~~~~~~~~~~~~~~~~~~
  114. * Number formatting and the :setting:`NUMBER_GROUPING` setting support
  115. non-uniform digit grouping.
  116. Management Commands
  117. ~~~~~~~~~~~~~~~~~~~
  118. * The new :option:`loaddata --exclude` option allows excluding models and apps
  119. while loading data from fixtures.
  120. Migrations
  121. ~~~~~~~~~~
  122. * ...
  123. Models
  124. ~~~~~~
  125. * Added support for callable values in the ``defaults`` argument of
  126. :meth:`QuerySet.update_or_create()
  127. <django.db.models.query.QuerySet.update_or_create>` and
  128. :meth:`~django.db.models.query.QuerySet.get_or_create`.
  129. Requests and Responses
  130. ~~~~~~~~~~~~~~~~~~~~~~
  131. * Added :meth:`QueryDict.fromkeys() <django.http.QueryDict.fromkeys>`.
  132. Serialization
  133. ~~~~~~~~~~~~~
  134. * The new ``django.core.serializers.base.Serializer.stream_class`` attribute
  135. allows subclasses to customize the default stream.
  136. Signals
  137. ~~~~~~~
  138. * ...
  139. Templates
  140. ~~~~~~~~~
  141. * :meth:`~django.utils.safestring.mark_safe` can now be used as a decorator.
  142. Tests
  143. ~~~~~
  144. * ...
  145. URLs
  146. ~~~~
  147. * ...
  148. Validators
  149. ~~~~~~~~~~
  150. * ...
  151. .. _backwards-incompatible-1.11:
  152. Backwards incompatible changes in 1.11
  153. ======================================
  154. :mod:`django.contrib.gis`
  155. -------------------------
  156. * To simplify the codebase and because it's easier to install than when
  157. ``contrib.gis`` was first released, :ref:`gdalbuild` is now a required
  158. dependency for GeoDjango. In older versions, it's only required for SQLite.
  159. Database backend API
  160. --------------------
  161. * ...
  162. Dropped support for PostgreSQL 9.2 and PostGIS 2.0
  163. --------------------------------------------------
  164. Upstream support for PostgreSQL 9.2 ends in September 2017. As a consequence,
  165. Django 1.11 sets PostgreSQL 9.3 as the minimum version it officially supports.
  166. Support for PostGIS 2.0 is also removed as PostgreSQL 9.2 is the last version
  167. to support it.
  168. ``LiveServerTestCase`` binds to port zero
  169. -----------------------------------------
  170. Rather than taking a port range and iterating to find a free port,
  171. ``LiveServerTestCase`` binds to port zero and relies on the operating system
  172. to assign a free port. The ``DJANGO_LIVE_TEST_SERVER_ADDRESS`` environment
  173. variable is no longer used, and as it's also no longer used, the
  174. ``manage.py test --liveserver`` option is removed.
  175. Miscellaneous
  176. -------------
  177. * If no items in the feed have a ``pubdate`` or ``updateddate`` attribute,
  178. :meth:`SyndicationFeed.latest_post_date()
  179. <django.utils.feedgenerator.SyndicationFeed.latest_post_date>` now returns
  180. the current UTC date/time, instead of a datetime without any timezone
  181. information.
  182. * Support for SpatiaLite < 4.0 is dropped.
  183. * CSRF failures are logged to the ``django.security.csrf`` logger instead of
  184. ``django.request``.
  185. * :setting:`ALLOWED_HOSTS` validation is no longer disabled when running tests.
  186. If your application includes tests with custom host names, you must include
  187. those host names in :setting:`ALLOWED_HOSTS`. See
  188. :ref:`topics-testing-advanced-multiple-hosts`.
  189. * Using a foreign key's id (e.g. ``'field_id'``) in ``ModelAdmin.list_display``
  190. displays the related object's ID. Remove the ``_id`` suffix if you want the
  191. old behavior of the string representation of the object.
  192. * In model forms, :class:`~django.db.models.CharField` with ``null=True`` now
  193. saves ``NULL`` for blank values instead of empty strings.
  194. * On Oracle, :meth:`Model.validate_unique()
  195. <django.db.models.Model.validate_unique>` no longer checks empty strings for
  196. uniqueness as the database interprets the value as ``NULL``.
  197. .. _deprecated-features-1.11:
  198. Features deprecated in 1.11
  199. ===========================
  200. Miscellaneous
  201. -------------
  202. * ``contrib.auth``’s ``login()`` and ``logout()`` function-based views are
  203. deprecated in favor of new class-based views
  204. :class:`~django.contrib.auth.views.LoginView` and
  205. :class:`~django.contrib.auth.views.LogoutView`.