  
  Related set direct assignment
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  :ref:`Direct assignment <direct-assignment>`) used to perform a ``clear()``
  followed by a call to ``add()``. This caused needlessly large data changes
  and prevented using the :data:`~django.db.models.signals.m2m_changed` signal
  to track individual changes in many-to-many relations.
  
  Direct assignment now relies on the the new
  :meth:`django.db.models.fields.related.RelatedManager.set()` method on
  related managers which by default only processes changes between the
  existing related set and the one that's newly assigned. The previous behavior
 
</s> remove :meth:`django.db.models.fields.related.RelatedManager.set()` method on
related managers which by default only processes changes between the
existing related set and the one that's newly assigned. The previous behavior
can be restored by replacing direct assignment by a call to ``set()`` with
the keyword argument ``clear=True``.
 </s> add :meth:`~django.db.models.fields.related.RelatedManager.set` method on related
managers which by default only processes changes between the existing related
set and the one that's newly assigned. The previous behavior can be restored by
replacing direct assignment by a call to ``set()`` with the keyword argument
``clear=True``. </s> remove * The new :setting:`CSRF_TRUSTED_ORIGINS` setting provides a way to allow
  cross-origin unsafe requests (e.g. ``POST``) over HTTPS.
 </s> add * The default 40x error views now accept a second positional parameter, the
  exception that triggered the view.

* View error handlers now support
  :class:`~django.template.response.TemplateResponse`, commonly used with
  class-based views.

* Exceptions raised by the ``render()`` method are now passed to the
  ``process_exception()`` method of each middleware.

* Request middleware can now set :attr:`HttpRequest.urlconf
  <django.http.HttpRequest.urlconf>` to ``None`` to revert any changes made
  by previous middleware and return to using the :setting:`ROOT_URLCONF`.

* The :setting:`DISALLOWED_USER_AGENTS` check in
  :class:`~django.middleware.common.CommonMiddleware` now raises a
  :class:`~django.core.exceptions.PermissionDenied` exception as opposed to
  returning an :class:`~django.http.HttpResponseForbidden` so that
  :data:`~django.conf.urls.handler403` is invoked.

* Added :meth:`HttpRequest.get_port() <django.http.HttpRequest.get_port>` to
  fetch the originating port of the request.

* Added the ``json_dumps_params`` parameter to
  :class:`~django.http.JsonResponse` to allow passing keyword arguments to the
  ``json.dumps()`` call used to generate the response.

* The :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` now
  ignores 404s when the referer is equal to the requested URL. To circumvent
  the empty referer check already implemented, some Web bots set the referer to
  the requested URL. </s> remove Requests and Responses
^^^^^^^^^^^^^^^^^^^^^^

* Unless :attr:`HttpResponse.reason_phrase
  <django.http.HttpResponse.reason_phrase>` is explicitly set, it now is
  determined by the current value of :attr:`HttpResponse.status_code
  <django.http.HttpResponse.status_code>`. Modifying the value of
  ``status_code`` outside of the constructor will also modify the value of
  ``reason_phrase``.

* The debug view now shows details of chained exceptions on Python 3.

* The default 40x error views now accept a second positional parameter, the
  exception that triggered the view.

* View error handlers now support
  :class:`~django.template.response.TemplateResponse`, commonly used with
  class-based views.

* Exceptions raised by the ``render()`` method are now passed to the
  ``process_exception()`` method of each middleware.

* Request middleware can now set :attr:`HttpRequest.urlconf
  <django.http.HttpRequest.urlconf>` to ``None`` to revert any changes made
  by previous middleware and return to using the :setting:`ROOT_URLCONF`.

* The :setting:`DISALLOWED_USER_AGENTS` check in
  :class:`~django.middleware.common.CommonMiddleware` now raises a
  :class:`~django.core.exceptions.PermissionDenied` exception as opposed to
  returning an :class:`~django.http.HttpResponseForbidden` so that
  :data:`~django.conf.urls.handler403` is invoked.

* Added :meth:`HttpRequest.get_port() <django.http.HttpRequest.get_port>` to
  fetch the originating port of the request.

* Added the ``json_dumps_params`` parameter to
  :class:`~django.http.JsonResponse` to allow passing keyword arguments to the
  ``json.dumps()`` call used to generate the response.

* The :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` now
  ignores 404s when the referer is equal to the requested URL. To circumvent
  the empty referer check already implemented, some Web bots set the referer to
  the requested URL.

 </s> add  </s> remove If you fail to do so, Django 1.9 and 2.0 will perform the conversion like
earlier versions but emit a deprecation warning. Django 2.0 won't perform any
 </s> add If you fail to do so, the conversion will be performed as in earlier versions
(with a deprecation warning) up until Django 1.11. Django 2.0 won't perform any </s> remove     :doc:`deprecation timeline </internals/deprecation>` for any features that
    have been removed. If you haven't updated your code within the
    deprecation timeline for a given feature, its removal may appear as a
    backwards incompatible change.
 </s> add     :ref:`removed-features-1.9` for the features that have reached the end of
    their deprecation cycle and therefore been removed. If you haven't updated
    your code within the deprecation timeline for a given feature, its removal
    may appear as a backwards incompatible change.
:ref:`Direct assignment <direct-assignment>` of related objects in the ORM used
to perform a ``clear()`` followed by a call to ``add()``. This caused
needlessly large data changes and prevented using the
:data:`~django.db.models.signals.m2m_changed` signal to track individual
changes in many-to-many relations.
  
  Related set direct assignment
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
:ref:`Direct assignment <direct-assignment>` of related objects in the ORM used
to perform a ``clear()`` followed by a call to ``add()``. This caused
needlessly large data changes and prevented using the
:data:`~django.db.models.signals.m2m_changed` signal to track individual
changes in many-to-many relations.
:ref:`Direct assignment <direct-assignment>` of related objects in the ORM used
to perform a ``clear()`` followed by a call to ``add()``. This caused
needlessly large data changes and prevented using the
:data:`~django.db.models.signals.m2m_changed` signal to track individual
changes in many-to-many relations.
:ref:`Direct assignment <direct-assignment>` of related objects in the ORM used
to perform a ``clear()`` followed by a call to ``add()``. This caused
needlessly large data changes and prevented using the
:data:`~django.db.models.signals.m2m_changed` signal to track individual
changes in many-to-many relations.
:ref:`Direct assignment <direct-assignment>` of related objects in the ORM used
to perform a ``clear()`` followed by a call to ``add()``. This caused
needlessly large data changes and prevented using the
:data:`~django.db.models.signals.m2m_changed` signal to track individual
changes in many-to-many relations.
  
  Direct assignment now relies on the the new
  :meth:`django.db.models.fields.related.RelatedManager.set()` method on
  related managers which by default only processes changes between the
  existing related set and the one that's newly assigned. The previous behavior
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Alphabetized a few sections in the 1.9 release notes + made a few tweaks. 
docs/releases/1.9.txt