2013-07-01 19:53:06 +08:00
|
|
|
============================================
|
|
|
|
Django 1.7 release notes - UNDER DEVELOPMENT
|
|
|
|
============================================
|
|
|
|
|
|
|
|
Welcome to Django 1.7!
|
|
|
|
|
|
|
|
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.6 or older versions. We've also dropped some features, which are detailed in
|
|
|
|
:doc:`our deprecation plan </internals/deprecation>`, and we've `begun the
|
|
|
|
deprecation process for some features`_.
|
|
|
|
|
|
|
|
.. _`new features`: `What's new in Django 1.7`_
|
|
|
|
.. _`backwards incompatible changes`: `Backwards incompatible changes in 1.7`_
|
|
|
|
.. _`begun the deprecation process for some features`: `Features deprecated in 1.7`_
|
|
|
|
|
2013-07-14 01:29:11 +08:00
|
|
|
Python compatibility
|
|
|
|
====================
|
|
|
|
|
|
|
|
Django 1.7 requires Python 2.7 or above, though we **highly recommend**
|
|
|
|
the latest minor release. Support for Python 2.6 has been dropped.
|
|
|
|
|
|
|
|
This change should affect only a small number of Django users, as most
|
|
|
|
operating-system vendors today are shipping Python 2.7 or newer as their default
|
|
|
|
version. If you're still using Python 2.6, however, you'll need to stick to
|
|
|
|
Django 1.6 until you can upgrade your Python version. Per :doc:`our support
|
|
|
|
policy </internals/release-process>`, Django 1.6 will continue to receive
|
|
|
|
security support until the release of Django 1.8.
|
|
|
|
|
2013-07-01 19:53:06 +08:00
|
|
|
What's new in Django 1.7
|
|
|
|
========================
|
|
|
|
|
2013-07-30 18:52:36 +08:00
|
|
|
Schema migrations
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Django now has built-in support for schema migrations, which allows models
|
|
|
|
to be updated, changed and deleted and the changes stored into migration files
|
|
|
|
and then run on any deployed database.
|
|
|
|
|
|
|
|
Migrations are covered in :doc:`their own documentation</topics/migrations>`,
|
|
|
|
but a few of the key features are:
|
|
|
|
|
|
|
|
* ``syncdb`` has been deprecated and replaced by ``migrate``. Don't worry -
|
|
|
|
calls to ``syncdb`` will still work as before.
|
|
|
|
|
|
|
|
* A new ``makemigrations`` command provides an easy way to autodetect changes
|
|
|
|
to your models and make migrations for them.
|
|
|
|
|
|
|
|
* :data:`~django.db.models.signals.post_syncdb` and
|
|
|
|
:data:`~django.db.models.signals.post_syncdb` have been renamed to
|
|
|
|
:data:`~django.db.models.signals.pre_migrate` and
|
|
|
|
:data:`~django.db.models.signals.post_migrate` respectively. The
|
|
|
|
``create_models``/``created_models`` argument has also been deprecated.
|
|
|
|
|
|
|
|
* Routers something something.
|
|
|
|
|
2013-07-01 22:48:14 +08:00
|
|
|
Admin shortcuts support time zones
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The "today" and "now" shortcuts next to date and time input widgets in the
|
|
|
|
admin are now operating in the :ref:`current time zone
|
|
|
|
<default-current-time-zone>`. Previously, they used the browser time zone,
|
|
|
|
which could result in saving the wrong value when it didn't match the current
|
|
|
|
time zone on the server.
|
|
|
|
|
|
|
|
In addition, the widgets now display a help message when the browser and
|
|
|
|
server time zone are different, to clarify how the value inserted in the field
|
|
|
|
will be interpreted.
|
|
|
|
|
2013-04-20 01:20:23 +08:00
|
|
|
Minor features
|
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* The new :attr:`UploadedFile.content_type_extra
|
|
|
|
<django.core.files.uploadedfile.UploadedFile.content_type_extra>` attribute
|
|
|
|
contains extra parameters passed to the ``content-type`` header on a file
|
|
|
|
upload.
|
|
|
|
|
2013-05-18 19:43:51 +08:00
|
|
|
* The ``enter`` argument was added to the
|
|
|
|
:data:`~django.test.signals.setting_changed` signal.
|
|
|
|
|
2013-05-18 19:49:06 +08:00
|
|
|
* The :meth:`QuerySet.update_or_create()
|
|
|
|
<django.db.models.query.QuerySet.update_or_create>` method was added.
|
|
|
|
|
2013-07-17 01:21:17 +08:00
|
|
|
* :attr:`~django.db.models.Options.app_label` is no longer required for models
|
|
|
|
that are defined in a ``models`` package within an app.
|
|
|
|
|
2013-07-16 19:11:32 +08:00
|
|
|
* The :meth:`Context.push() <django.template.Context.push>` method now returns
|
|
|
|
a context manager which automatically calls :meth:`pop()
|
|
|
|
<django.template.Context.pop>` upon exiting the ``with`` statement.
|
|
|
|
Additionally, :meth:`push() <django.template.Context.push>` now accepts
|
|
|
|
parameters that are passed to the ``dict`` constructor used to build the new
|
|
|
|
context level.
|
|
|
|
|
2013-07-18 03:20:20 +08:00
|
|
|
* The :class:`~django.utils.feedgenerator.Atom1Feed` syndication feed's
|
|
|
|
``updated`` element now utilizes `updateddate` instead of ``pubdate``,
|
|
|
|
allowing the ``published`` element to be included in the feed (which
|
|
|
|
relies on ``pubdate``).
|
|
|
|
|
2013-07-01 19:53:06 +08:00
|
|
|
Backwards incompatible changes in 1.7
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
In addition to the changes outlined in this section, be sure to review the
|
|
|
|
:doc:`deprecation plan </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.
|
|
|
|
|
2013-04-20 01:20:23 +08:00
|
|
|
Miscellaneous
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* The :meth:`django.core.files.uploadhandler.FileUploadHandler.new_file()`
|
|
|
|
method is now passed an additional ``content_type_extra`` parameter. If you
|
|
|
|
have a custom :class:`~django.core.files.uploadhandler.FileUploadHandler`
|
|
|
|
that implements ``new_file()``, be sure it accepts this new parameter.
|
|
|
|
|
2013-07-01 19:53:06 +08:00
|
|
|
Features deprecated in 1.7
|
|
|
|
==========================
|
|
|
|
|
2013-07-02 04:50:58 +08:00
|
|
|
``django.utils.dictconfig``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``django.utils.dictconfig`` was a copy of :mod:`logging.config` provided for
|
|
|
|
Python versions prior to 2.7. It has been deprecated.
|
|
|
|
|
2013-07-01 19:53:06 +08:00
|
|
|
``django.utils.unittest``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``django.utils.unittest`` provided uniform access to the ``unittest2`` library
|
|
|
|
on all Python versions. Since ``unittest2`` became the standard library's
|
|
|
|
:mod:`unittest` module in Python 2.7, and Django 1.7 drops support for older
|
|
|
|
Python versions, this module isn't useful anymore. It has been deprecated. Use
|
|
|
|
:mod:`unittest` instead.
|