1.11.txt 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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. * :class:`~django.middleware.common.CommonMiddleware` now sets the
  133. ``Content-Length`` response header for non-streaming responses.
  134. Serialization
  135. ~~~~~~~~~~~~~
  136. * The new ``django.core.serializers.base.Serializer.stream_class`` attribute
  137. allows subclasses to customize the default stream.
  138. * The encoder used by the :ref:`JSON serializer <serialization-formats-json>`
  139. can now be customized by passing a ``cls`` keyword argument to the
  140. ``serializers.serialize()`` function.
  141. Signals
  142. ~~~~~~~
  143. * ...
  144. Templates
  145. ~~~~~~~~~
  146. * :meth:`~django.utils.safestring.mark_safe` can now be used as a decorator.
  147. Tests
  148. ~~~~~
  149. * ...
  150. URLs
  151. ~~~~
  152. * ...
  153. Validators
  154. ~~~~~~~~~~
  155. * ...
  156. .. _backwards-incompatible-1.11:
  157. Backwards incompatible changes in 1.11
  158. ======================================
  159. :mod:`django.contrib.gis`
  160. -------------------------
  161. * To simplify the codebase and because it's easier to install than when
  162. ``contrib.gis`` was first released, :ref:`gdalbuild` is now a required
  163. dependency for GeoDjango. In older versions, it's only required for SQLite.
  164. Database backend API
  165. --------------------
  166. * ...
  167. Dropped support for PostgreSQL 9.2 and PostGIS 2.0
  168. --------------------------------------------------
  169. Upstream support for PostgreSQL 9.2 ends in September 2017. As a consequence,
  170. Django 1.11 sets PostgreSQL 9.3 as the minimum version it officially supports.
  171. Support for PostGIS 2.0 is also removed as PostgreSQL 9.2 is the last version
  172. to support it.
  173. ``LiveServerTestCase`` binds to port zero
  174. -----------------------------------------
  175. Rather than taking a port range and iterating to find a free port,
  176. ``LiveServerTestCase`` binds to port zero and relies on the operating system
  177. to assign a free port. The ``DJANGO_LIVE_TEST_SERVER_ADDRESS`` environment
  178. variable is no longer used, and as it's also no longer used, the
  179. ``manage.py test --liveserver`` option is removed.
  180. Miscellaneous
  181. -------------
  182. * If no items in the feed have a ``pubdate`` or ``updateddate`` attribute,
  183. :meth:`SyndicationFeed.latest_post_date()
  184. <django.utils.feedgenerator.SyndicationFeed.latest_post_date>` now returns
  185. the current UTC date/time, instead of a datetime without any timezone
  186. information.
  187. * Support for SpatiaLite < 4.0 is dropped.
  188. * CSRF failures are logged to the ``django.security.csrf`` logger instead of
  189. ``django.request``.
  190. * :setting:`ALLOWED_HOSTS` validation is no longer disabled when running tests.
  191. If your application includes tests with custom host names, you must include
  192. those host names in :setting:`ALLOWED_HOSTS`. See
  193. :ref:`topics-testing-advanced-multiple-hosts`.
  194. * Using a foreign key's id (e.g. ``'field_id'``) in ``ModelAdmin.list_display``
  195. displays the related object's ID. Remove the ``_id`` suffix if you want the
  196. old behavior of the string representation of the object.
  197. * In model forms, :class:`~django.db.models.CharField` with ``null=True`` now
  198. saves ``NULL`` for blank values instead of empty strings.
  199. * On Oracle, :meth:`Model.validate_unique()
  200. <django.db.models.Model.validate_unique>` no longer checks empty strings for
  201. uniqueness as the database interprets the value as ``NULL``.
  202. * If you subclass :class:`.AbstractUser` and override ``clean()``, be sure it
  203. calls ``super()``. :meth:`.BaseUserManager.normalize_email` is called in a
  204. new :meth:`.AbstractUser.clean` method so that normalization is applied in
  205. cases like model form validation.
  206. .. _deprecated-features-1.11:
  207. Features deprecated in 1.11
  208. ===========================
  209. Miscellaneous
  210. -------------
  211. * ``contrib.auth``’s ``login()`` and ``logout()`` function-based views are
  212. deprecated in favor of new class-based views
  213. :class:`~django.contrib.auth.views.LoginView` and
  214. :class:`~django.contrib.auth.views.LogoutView`.