2015-01-17 07:00:45 +08:00
|
|
|
============================================
|
|
|
|
Django 1.9 release notes - UNDER DEVELOPMENT
|
|
|
|
============================================
|
|
|
|
|
|
|
|
Welcome to Django 1.9!
|
|
|
|
|
|
|
|
These release notes cover the `new features`_, as well as some `backwards
|
|
|
|
incompatible changes`_ you'll want to be aware of when upgrading from Django
|
|
|
|
1.8 or older versions. We've :ref:`dropped some features
|
|
|
|
<deprecation-removed-in-1.9>` that have reached the end of their deprecation
|
|
|
|
cycle, and we've `begun the deprecation process for some features`_.
|
|
|
|
|
|
|
|
.. _`new features`: `What's new in Django 1.9`_
|
|
|
|
.. _`backwards incompatible changes`: `Backwards incompatible changes in 1.9`_
|
|
|
|
.. _`dropped some features`: `Features removed in 1.9`_
|
|
|
|
.. _`begun the deprecation process for some features`: `Features deprecated in 1.9`_
|
|
|
|
|
|
|
|
Python compatibility
|
|
|
|
====================
|
|
|
|
|
|
|
|
Like Django 1.8, Django 1.9 requires Python 2.7 or above, though we
|
|
|
|
**highly recommend** the latest minor release. We've dropped support for
|
|
|
|
Python 3.2 and added support for Python 3.5.
|
|
|
|
|
|
|
|
What's new in Django 1.9
|
|
|
|
========================
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
Minor features
|
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
:mod:`django.contrib.admin`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2014-12-27 15:16:53 +08:00
|
|
|
* Admin views now have ``model_admin`` or ``admin_site`` attributes.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
:mod:`django.contrib.auth`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2015-01-17 08:27:10 +08:00
|
|
|
* The default iteration count for the PBKDF2 password hasher has been increased
|
|
|
|
by 20%. This backwards compatible change will not affect users who have
|
|
|
|
subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
|
|
|
|
default value.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
:mod:`django.contrib.gis`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.messages`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.redirects`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sessions`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sitemaps`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sites`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.staticfiles`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.syndication`
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Cache
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Email
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
File Storage
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
File Uploads
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Forms
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
2014-12-27 15:16:53 +08:00
|
|
|
Generic Views
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* Class based views generated using ``as_view()`` now have ``view_class``
|
|
|
|
and ``view_initkwargs`` attributes.
|
|
|
|
|
2015-01-17 07:00:45 +08:00
|
|
|
Internationalization
|
|
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Management Commands
|
|
|
|
^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Models
|
|
|
|
^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Signals
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Templates
|
|
|
|
^^^^^^^^^
|
|
|
|
|
2015-01-17 07:34:32 +08:00
|
|
|
* Template tags created with the :meth:`~django.template.Library.simple_tag`
|
|
|
|
helper can now store results in a template variable by using the ``as``
|
|
|
|
argument.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
Requests and Responses
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Tests
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Validators
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Backwards incompatible changes in 1.9
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
In addition to the changes outlined in this section, be sure to review the
|
|
|
|
: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.
|
|
|
|
|
2014-12-30 00:41:16 +08:00
|
|
|
Database backend API
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* A couple of new tests rely on the ability of the backend to introspect column
|
|
|
|
defaults (returning the result as ``Field.default``). You can set the
|
|
|
|
``can_introspect_default`` database feature to ``False`` if your backend
|
|
|
|
doesn't implement this. You may want to review the implementation on the
|
|
|
|
backends that Django includes for reference (:ticket:`24245`).
|
|
|
|
|
2015-01-22 00:55:57 +08:00
|
|
|
Default settings that were tuples are now lists
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The default settings in ``django.conf.global_settings`` were a combination of
|
|
|
|
lists and tuples. All settings that were formerly tuples are now lists.
|
|
|
|
|
2015-01-17 07:00:45 +08:00
|
|
|
Miscellaneous
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
2015-01-27 12:02:53 +08:00
|
|
|
* CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have
|
|
|
|
been removed as these browsers have reached end-of-life.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
2015-01-14 03:29:07 +08:00
|
|
|
* ``django.http.responses.REASON_PHRASES`` and
|
|
|
|
``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use
|
|
|
|
Python's stdlib instead: :data:`http.client.responses` for Python 3 and
|
|
|
|
`httplib.responses`_ for Python 2.
|
|
|
|
|
|
|
|
.. _`httplib.responses`: https://docs.python.org/2/library/httplib.html#httplib.responses
|
|
|
|
|
2015-01-30 15:26:13 +08:00
|
|
|
* ``ValuesQuerySet`` and ``ValuesListQuerySet`` have been removed.
|
|
|
|
|
2015-01-17 07:00:45 +08:00
|
|
|
.. _deprecated-features-1.9:
|
|
|
|
|
|
|
|
Features deprecated in 1.9
|
|
|
|
==========================
|
|
|
|
|
2015-01-17 07:34:32 +08:00
|
|
|
``assignment_tag()``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Django 1.4 added the ``assignment_tag`` helper to ease the creation of
|
|
|
|
template tags that store results in a template variable. The
|
|
|
|
:meth:`~django.template.Library.simple_tag` helper has gained this same
|
|
|
|
ability, making the ``assignment_tag`` obsolete. Tags that use
|
|
|
|
``assignment_tag`` should be updated to use ``simple_tag``.
|
|
|
|
|
2015-01-22 02:26:51 +08:00
|
|
|
Miscellaneous
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has
|
|
|
|
been deprecated as it has no effect.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
2015-01-27 12:29:06 +08:00
|
|
|
* The ``check_aggregate_support()`` method of
|
|
|
|
``django.db.backends.base.BaseDatabaseOperations`` has been deprecated and
|
|
|
|
will be removed in Django 2.1. The more general ``check_expression_support()``
|
|
|
|
should be used instead.
|
|
|
|
|
2015-01-28 02:50:00 +08:00
|
|
|
* ``django.forms.extras`` is deprecated. You can find
|
2015-01-26 11:28:57 +08:00
|
|
|
:class:`~django.forms.SelectDateWidget` in ``django.forms.widgets``
|
|
|
|
(or simply ``django.forms``) instead.
|
|
|
|
|
2015-01-17 07:00:45 +08:00
|
|
|
.. removed-features-1.9:
|
|
|
|
|
|
|
|
Features removed in 1.9
|
|
|
|
=======================
|
|
|
|
|
|
|
|
These features have reached the end of their deprecation cycle and so have been
|
|
|
|
removed in Django 1.9 (please see the :ref:`deprecation timeline
|
|
|
|
<deprecation-removed-in-1.9>` for more details):
|
|
|
|
|
|
|
|
* ``django.utils.dictconfig`` is removed.
|
|
|
|
|
|
|
|
* ``django.utils.importlib`` is removed.
|
|
|
|
|
|
|
|
* ``django.utils.tzinfo`` is removed.
|
|
|
|
|
|
|
|
* ``django.utils.unittest`` is removed.
|
|
|
|
|
|
|
|
* The ``syncdb`` command is removed.
|
|
|
|
|
|
|
|
* ``django.db.models.signals.pre_syncdb`` and
|
|
|
|
``django.db.models.signals.post_syncdb`` is removed.
|
|
|
|
|
|
|
|
* Support for ``allow_syncdb`` on database routers is removed.
|
|
|
|
|
|
|
|
* The legacy method of syncing apps without migrations is removed,
|
|
|
|
and migrations are compulsory for all apps. This includes automatic
|
|
|
|
loading of ``initial_data`` fixtures and support for initial SQL data.
|
|
|
|
|
|
|
|
* All models need to be defined inside an installed application or declare an
|
|
|
|
explicit :attr:`~django.db.models.Options.app_label`. Furthermore, it isn't
|
|
|
|
possible to import them before their application is loaded. In particular, it
|
|
|
|
isn't possible to import models inside the root package of an application.
|
|
|
|
|
|
|
|
* The model and form ``IPAddressField`` is removed. A stub field remains for
|
|
|
|
compatibility with historical migrations.
|
|
|
|
|
|
|
|
* ``AppCommand.handle_app()`` is no longer be supported.
|
|
|
|
|
2015-01-19 10:57:38 +08:00
|
|
|
* ``RequestSite`` and ``get_current_site()`` are no longer importable from
|
|
|
|
``django.contrib.sites.models``.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
* FastCGI support via the ``runfcgi`` management command is removed.
|
|
|
|
|
|
|
|
* ``django.utils.datastructures.SortedDict`` is removed.
|
|
|
|
|
|
|
|
* ``ModelAdmin.declared_fieldsets`` is removed.
|
|
|
|
|
2015-01-19 10:57:38 +08:00
|
|
|
* The ``util`` modules that provided backwards compatibility are removed:
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
* ``django.contrib.admin.util``
|
|
|
|
* ``django.contrib.gis.db.backends.util``
|
|
|
|
* ``django.db.backends.util``
|
|
|
|
* ``django.forms.util``
|
|
|
|
|
|
|
|
* ``ModelAdmin.get_formsets`` is removed.
|
|
|
|
|
|
|
|
* The backward compatible shims introduced to rename the
|
|
|
|
``BaseMemcachedCache._get_memcache_timeout()`` method to
|
|
|
|
``get_backend_timeout()`` is removed.
|
|
|
|
|
|
|
|
* The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` are removed.
|
|
|
|
|
|
|
|
* The ``use_natural_keys`` argument for ``serializers.serialize()`` is removed.
|
|
|
|
|
2015-01-19 10:57:38 +08:00
|
|
|
* Private API ``django.forms.forms.get_declared_fields()`` is removed.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
* The ability to use a ``SplitDateTimeWidget`` with ``DateTimeField`` is
|
|
|
|
removed.
|
|
|
|
|
|
|
|
* The ``WSGIRequest.REQUEST`` property is removed.
|
|
|
|
|
|
|
|
* The class ``django.utils.datastructures.MergeDict`` is removed.
|
|
|
|
|
|
|
|
* The ``zh-cn`` and ``zh-tw`` language codes are removed.
|
|
|
|
|
|
|
|
* The internal ``django.utils.functional.memoize()`` is removed.
|
|
|
|
|
|
|
|
* ``django.core.cache.get_cache`` is removed.
|
|
|
|
|
|
|
|
* ``django.db.models.loading`` is removed.
|
|
|
|
|
|
|
|
* Passing callable arguments to querysets is no longer possible.
|
|
|
|
|
|
|
|
* ``BaseCommand.requires_model_validation`` is removed in favor of
|
|
|
|
``requires_system_checks``. Admin validators is replaced by admin checks.
|
|
|
|
|
2015-01-19 10:57:38 +08:00
|
|
|
* The ``ModelAdmin.validator_class`` and ``default_validator_class`` attributes
|
|
|
|
are removed.
|
|
|
|
|
|
|
|
* ``ModelAdmin.validate()`` is removed.
|
2015-01-17 07:00:45 +08:00
|
|
|
|
|
|
|
* ``django.db.backends.DatabaseValidation.validate_field`` is removed in
|
|
|
|
favor of the ``check_field`` method.
|
|
|
|
|
2015-01-18 08:14:44 +08:00
|
|
|
* The ``check`` management command is removed.
|
|
|
|
|
2015-01-17 07:00:45 +08:00
|
|
|
* ``django.utils.module_loading.import_by_path`` is removed in favor of
|
|
|
|
``django.utils.module_loading.import_string``.
|
|
|
|
|
|
|
|
* ``ssi`` and ``url`` template tags are removed from the ``future`` template
|
|
|
|
tag library.
|
|
|
|
|
|
|
|
* ``django.utils.text.javascript_quote()`` is removed.
|
|
|
|
|
|
|
|
* Database test settings as independent entries in the database settings,
|
|
|
|
prefixed by ``TEST_``, are no longer supported.
|
|
|
|
|
|
|
|
* The `cache_choices` option to :class:`~django.forms.ModelChoiceField` and
|
|
|
|
:class:`~django.forms.ModelMultipleChoiceField` is removed.
|
|
|
|
|
|
|
|
* The default value of the
|
|
|
|
:attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
|
|
|
|
attribute has changed from ``True`` to ``False``.
|
|
|
|
|
|
|
|
* ``django.contrib.sitemaps.FlatPageSitemap`` is removed in favor of
|
|
|
|
``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
|
2015-01-19 10:57:38 +08:00
|
|
|
|
|
|
|
* Private API ``django.test.utils.TestTemplateLoader`` is removed.
|
|
|
|
|
|
|
|
* The ``django.contrib.contenttypes.generic`` module is removed.
|