2013-02-28 11:05:26 +01:00
|
|
|
|
========================
|
|
|
|
|
Django 1.5 release notes
|
|
|
|
|
========================
|
2012-03-30 11:33:51 +02:00
|
|
|
|
|
2013-02-26 20:12:27 +01:00
|
|
|
|
*February 26, 2013*
|
|
|
|
|
|
2012-10-25 20:59:13 +02:00
|
|
|
|
Welcome to Django 1.5!
|
|
|
|
|
|
2016-06-02 17:41:49 +02:00
|
|
|
|
These release notes cover the :ref:`new features <whats-new-1.5>`, as well as
|
|
|
|
|
some :ref:`backwards incompatible changes <backwards-incompatible-1.5>` you'll
|
|
|
|
|
want to be aware of when upgrading from Django 1.4 or older versions. We've
|
|
|
|
|
also dropped some features, which are detailed in :ref:`our deprecation plan
|
|
|
|
|
<deprecation-removed-in-1.5>`, and we've :ref:`begun the deprecation process
|
|
|
|
|
for some features <deprecated-features-1.5>`.
|
2012-03-30 11:33:51 +02:00
|
|
|
|
|
2012-10-25 20:59:13 +02:00
|
|
|
|
Overview
|
|
|
|
|
========
|
|
|
|
|
|
|
|
|
|
The biggest new feature in Django 1.5 is the `configurable User model`_. Before
|
|
|
|
|
Django 1.5, applications that wanted to use Django's auth framework
|
|
|
|
|
(:mod:`django.contrib.auth`) were forced to use Django's definition of a "user".
|
|
|
|
|
In Django 1.5, you can now swap out the ``User`` model for one that you write
|
|
|
|
|
yourself. This could be a simple extension to the existing ``User`` model -- for
|
|
|
|
|
example, you could add a Twitter or Facebook ID field -- or you could completely
|
|
|
|
|
replace the ``User`` with one totally customized for your site.
|
|
|
|
|
|
2012-10-25 23:20:55 +02:00
|
|
|
|
Django 1.5 is also the first release with `Python 3 support`_! We're labeling
|
2012-10-25 20:59:13 +02:00
|
|
|
|
this support "experimental" because we don't yet consider it production-ready,
|
|
|
|
|
but everything's in place for you to start porting your apps to Python 3.
|
|
|
|
|
Our next release, Django 1.6, will support Python 3 without reservations.
|
|
|
|
|
|
|
|
|
|
Other notable new features in Django 1.5 include:
|
|
|
|
|
|
|
|
|
|
* `Support for saving a subset of model's fields`_ -
|
|
|
|
|
:meth:`Model.save() <django.db.models.Model.save()>` now accepts an
|
|
|
|
|
``update_fields`` argument, letting you specify which fields are
|
2012-10-25 23:20:55 +02:00
|
|
|
|
written back to the database when you call ``save()``. This can help
|
|
|
|
|
in high-concurrency operations, and can improve performance.
|
2012-10-25 20:59:13 +02:00
|
|
|
|
|
|
|
|
|
* Better `support for streaming responses <#explicit-streaming-responses>`_ via
|
|
|
|
|
the new :class:`~django.http.StreamingHttpResponse` response class.
|
|
|
|
|
|
|
|
|
|
* `GeoDjango`_ now supports PostGIS 2.0.
|
|
|
|
|
|
|
|
|
|
* ... and more; `see below <#what-s-new-in-django-1-5>`_.
|
|
|
|
|
|
|
|
|
|
Wherever possible we try to introduce new features in a backwards-compatible
|
2012-11-18 20:08:45 +01:00
|
|
|
|
manner per :doc:`our API stability policy </misc/api-stability>`.
|
2012-10-25 20:59:13 +02:00
|
|
|
|
However, as with previous releases, Django 1.5 ships with some minor
|
2016-06-02 17:41:49 +02:00
|
|
|
|
:ref:`backwards incompatible changes <backwards-incompatible-1.5>`; people
|
|
|
|
|
upgrading from previous versions of Django should read that list carefully.
|
2012-10-25 20:59:13 +02:00
|
|
|
|
|
|
|
|
|
One deprecated feature worth noting is the shift to "new-style" :ttag:`url` tag.
|
|
|
|
|
Prior to Django 1.3, syntax like ``{% url myview %}`` was interpreted
|
|
|
|
|
incorrectly (Django considered ``"myview"`` to be a literal name of a view, not
|
|
|
|
|
a template variable named ``myview``). Django 1.3 and above introduced the
|
|
|
|
|
``{% load url from future %}`` syntax to bring in the corrected behavior where
|
|
|
|
|
``myview`` was seen as a variable.
|
|
|
|
|
|
|
|
|
|
The upshot of this is that if you are not using ``{% load url from future %}``
|
|
|
|
|
in your templates, you'll need to change tags like ``{% url myview %}`` to
|
|
|
|
|
``{% url "myview" %}``. If you *were* using ``{% load url from future %}`` you
|
|
|
|
|
can simply remove that line under Django 1.5
|
|
|
|
|
|
2012-03-30 11:33:51 +02:00
|
|
|
|
Python compatibility
|
|
|
|
|
====================
|
|
|
|
|
|
2013-01-08 04:16:46 +01:00
|
|
|
|
Django 1.5 requires Python 2.6.5 or above, though we **highly recommend**
|
2012-11-28 14:19:05 +01:00
|
|
|
|
Python 2.7.3 or above. Support for Python 2.5 and below has been dropped.
|
2012-03-30 11:33:51 +02:00
|
|
|
|
|
|
|
|
|
This change should affect only a small number of Django users, as most
|
|
|
|
|
operating-system vendors today are shipping Python 2.6 or newer as their default
|
|
|
|
|
version. If you're still using Python 2.5, however, you'll need to stick to
|
2012-10-25 20:59:13 +02:00
|
|
|
|
Django 1.4 until you can upgrade your Python version. Per :doc:`our support
|
|
|
|
|
policy </internals/release-process>`, Django 1.4 will continue to receive
|
|
|
|
|
security support until the release of Django 1.6.
|
|
|
|
|
|
|
|
|
|
Django 1.5 does not run on a Jython final release, because Jython's latest
|
|
|
|
|
release doesn't currently support Python 2.6. However, Jython currently does
|
|
|
|
|
offer an alpha release featuring 2.7 support, and Django 1.5 supports that alpha
|
|
|
|
|
release.
|
|
|
|
|
|
|
|
|
|
Python 3 support
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------
|
2012-10-25 20:59:13 +02:00
|
|
|
|
|
|
|
|
|
Django 1.5 introduces support for Python 3 - specifically, Python
|
|
|
|
|
3.2 and above. This comes in the form of a **single** codebase; you don't
|
|
|
|
|
need to install a different version of Django on Python 3. This means that
|
2012-11-27 22:49:00 +01:00
|
|
|
|
you can write applications targeted for just Python 2, just Python 3, or single
|
2012-10-25 20:59:13 +02:00
|
|
|
|
applications that support both platforms.
|
|
|
|
|
|
|
|
|
|
However, we're labeling this support "experimental" for now: although it's
|
2012-10-25 23:20:55 +02:00
|
|
|
|
received extensive testing via our automated test suite, it's received very
|
2012-10-25 20:59:13 +02:00
|
|
|
|
little real-world testing. We've done our best to eliminate bugs, but we can't
|
2012-12-28 21:42:58 +01:00
|
|
|
|
be sure we covered all possible uses of Django.
|
|
|
|
|
|
|
|
|
|
Some features of Django aren't available because they depend on third-party
|
|
|
|
|
software that hasn't been ported to Python 3 yet, including:
|
|
|
|
|
|
|
|
|
|
- the MySQL database backend (depends on MySQLdb)
|
2012-12-29 16:35:12 +01:00
|
|
|
|
- :class:`~django.db.models.ImageField` (depends on PIL)
|
2012-12-28 21:42:58 +01:00
|
|
|
|
- :class:`~django.test.LiveServerTestCase` (depends on Selenium WebDriver)
|
|
|
|
|
|
|
|
|
|
Further, Django's more than a web framework; it's an ecosystem of pluggable
|
|
|
|
|
components. At this point, very few third-party applications have been ported
|
|
|
|
|
to Python 3, so it's unlikely that a real-world application will have all its
|
|
|
|
|
dependencies satisfied under Python 3.
|
2012-10-25 20:59:13 +02:00
|
|
|
|
|
|
|
|
|
Thus, we're recommending that Django 1.5 not be used in production under Python
|
2017-01-18 17:51:29 +01:00
|
|
|
|
3. Instead, use this opportunity to begin porting applications to Python 3. If
|
|
|
|
|
you're an author of a pluggable component, we encourage you to start porting
|
|
|
|
|
now.
|
2012-03-30 11:33:51 +02:00
|
|
|
|
|
2012-10-25 20:59:13 +02:00
|
|
|
|
We plan to offer first-class, production-ready support for Python 3 in our next
|
|
|
|
|
release, Django 1.6.
|
2012-03-30 11:33:51 +02:00
|
|
|
|
|
2016-06-02 17:41:49 +02:00
|
|
|
|
.. _whats-new-1.5:
|
|
|
|
|
|
2012-03-30 11:33:51 +02:00
|
|
|
|
What's new in Django 1.5
|
|
|
|
|
========================
|
|
|
|
|
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
Configurable User model
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
|
|
|
|
|
In Django 1.5, you can now use your own model as the store for user-related
|
|
|
|
|
data. If your project needs a username with more than 30 characters, or if
|
2012-10-25 22:26:22 +02:00
|
|
|
|
you want to store user's names in a format other than first name/last name,
|
|
|
|
|
or you want to put custom profile information onto your User object, you can
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
now do so.
|
|
|
|
|
|
|
|
|
|
If you have a third-party reusable application that references the User model,
|
|
|
|
|
you may need to make some changes to the way you reference User instances. You
|
|
|
|
|
should also document any specific features of the User model that your
|
|
|
|
|
application relies upon.
|
|
|
|
|
|
2016-11-23 21:03:33 +01:00
|
|
|
|
See the :ref:`documentation on custom user models <auth-custom-user>` for
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
more details.
|
|
|
|
|
|
2012-05-12 09:24:20 +02:00
|
|
|
|
Support for saving a subset of model's fields
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------------------------
|
2012-05-12 09:24:20 +02:00
|
|
|
|
|
|
|
|
|
The method :meth:`Model.save() <django.db.models.Model.save()>` has a new
|
|
|
|
|
keyword argument ``update_fields``. By using this argument it is possible to
|
|
|
|
|
save only a select list of model's fields. This can be useful for performance
|
|
|
|
|
reasons or when trying to avoid overwriting concurrent changes.
|
|
|
|
|
|
2013-03-22 10:50:45 +01:00
|
|
|
|
Deferred instances (those loaded by ``.only()`` or ``.defer()``) will
|
|
|
|
|
automatically save just the loaded fields. If any field is set manually after
|
|
|
|
|
load, that field will also get updated on save.
|
2012-08-12 21:17:54 +02:00
|
|
|
|
|
2012-05-12 09:24:20 +02:00
|
|
|
|
See the :meth:`Model.save() <django.db.models.Model.save()>` documentation for
|
|
|
|
|
more details.
|
|
|
|
|
|
2012-05-24 13:25:01 +02:00
|
|
|
|
Caching of related model instances
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------
|
2012-05-24 13:25:01 +02:00
|
|
|
|
|
|
|
|
|
When traversing relations, the ORM will avoid re-fetching objects that were
|
|
|
|
|
previously loaded. For example, with the tutorial's models::
|
|
|
|
|
|
|
|
|
|
>>> first_poll = Poll.objects.all()[0]
|
|
|
|
|
>>> first_choice = first_poll.choice_set.all()[0]
|
|
|
|
|
>>> first_choice.poll is first_poll
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
In Django 1.5, the third line no longer triggers a new SQL query to fetch
|
2012-05-25 19:03:15 +02:00
|
|
|
|
``first_choice.poll``; it was set by the second line.
|
2012-05-24 13:25:01 +02:00
|
|
|
|
|
|
|
|
|
For one-to-one relationships, both sides can be cached. For many-to-one
|
|
|
|
|
relationships, only the single side of the relationship can be cached. This
|
|
|
|
|
is particularly helpful in combination with ``prefetch_related``.
|
|
|
|
|
|
2012-10-23 22:25:38 +02:00
|
|
|
|
.. _explicit-streaming-responses:
|
|
|
|
|
|
2012-10-20 17:40:14 +02:00
|
|
|
|
Explicit support for streaming responses
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------
|
2012-10-20 17:40:14 +02:00
|
|
|
|
|
|
|
|
|
Before Django 1.5, it was possible to create a streaming response by passing
|
|
|
|
|
an iterator to :class:`~django.http.HttpResponse`. But this was unreliable:
|
|
|
|
|
any middleware that accessed the :attr:`~django.http.HttpResponse.content`
|
|
|
|
|
attribute would consume the iterator prematurely.
|
|
|
|
|
|
|
|
|
|
You can now explicitly generate a streaming response with the new
|
|
|
|
|
:class:`~django.http.StreamingHttpResponse` class. This class exposes a
|
|
|
|
|
:class:`~django.http.StreamingHttpResponse.streaming_content` attribute which
|
|
|
|
|
is an iterator.
|
|
|
|
|
|
|
|
|
|
Since :class:`~django.http.StreamingHttpResponse` does not have a ``content``
|
2012-10-23 22:25:38 +02:00
|
|
|
|
attribute, middleware that needs access to the response content must test for
|
2015-11-07 16:12:37 +01:00
|
|
|
|
streaming responses and behave accordingly.
|
2012-10-20 17:40:14 +02:00
|
|
|
|
|
2012-06-07 09:59:14 +02:00
|
|
|
|
``{% verbatim %}`` template tag
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------------------------
|
2012-06-07 09:59:14 +02:00
|
|
|
|
|
2015-04-30 21:39:29 +02:00
|
|
|
|
To make it easier to deal with JavaScript templates which collide with Django's
|
2012-06-07 09:59:14 +02:00
|
|
|
|
syntax, you can now use the :ttag:`verbatim` block tag to avoid parsing the
|
|
|
|
|
tag's content.
|
|
|
|
|
|
2012-07-04 23:34:55 +02:00
|
|
|
|
Retrieval of ``ContentType`` instances associated with proxy models
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------------------------------------------------------------
|
2012-05-29 23:55:20 +02:00
|
|
|
|
|
2012-06-08 22:52:43 +02:00
|
|
|
|
The methods :meth:`ContentTypeManager.get_for_model() <django.contrib.contenttypes.models.ContentTypeManager.get_for_model()>`
|
|
|
|
|
and :meth:`ContentTypeManager.get_for_models() <django.contrib.contenttypes.models.ContentTypeManager.get_for_models()>`
|
|
|
|
|
have a new keyword argument – respectively ``for_concrete_model`` and ``for_concrete_models``.
|
2012-10-25 23:20:55 +02:00
|
|
|
|
By passing ``False`` using this argument it is now possible to retrieve the
|
2012-06-08 22:52:43 +02:00
|
|
|
|
:class:`ContentType <django.contrib.contenttypes.models.ContentType>`
|
2012-05-29 23:55:20 +02:00
|
|
|
|
associated with proxy models.
|
|
|
|
|
|
2012-08-18 15:46:17 +02:00
|
|
|
|
New ``view`` variable in class-based views context
|
2016-01-03 11:56:22 +01:00
|
|
|
|
--------------------------------------------------
|
2012-09-29 11:01:08 +02:00
|
|
|
|
|
2012-08-18 15:46:17 +02:00
|
|
|
|
In all :doc:`generic class-based views </topics/class-based-views/index>`
|
|
|
|
|
(or any class-based view inheriting from ``ContextMixin``), the context dictionary
|
|
|
|
|
contains a ``view`` variable that points to the ``View`` instance.
|
|
|
|
|
|
2012-09-29 11:01:08 +02:00
|
|
|
|
GeoDjango
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------
|
2012-09-29 11:01:08 +02:00
|
|
|
|
|
|
|
|
|
* :class:`~django.contrib.gis.geos.LineString` and
|
|
|
|
|
:class:`~django.contrib.gis.geos.MultiLineString` GEOS objects now support the
|
|
|
|
|
:meth:`~django.contrib.gis.geos.GEOSGeometry.interpolate()` and
|
|
|
|
|
:meth:`~django.contrib.gis.geos.GEOSGeometry.project()` methods
|
|
|
|
|
(so-called linear referencing).
|
|
|
|
|
|
2013-03-22 10:50:45 +01:00
|
|
|
|
* The ``wkb`` and ``hex`` properties of
|
|
|
|
|
:class:`~django.contrib.gis.geos.GEOSGeometry` objects preserve the Z
|
|
|
|
|
dimension.
|
2012-09-22 11:55:37 +02:00
|
|
|
|
|
2012-09-29 14:45:56 +02:00
|
|
|
|
* Support for PostGIS 2.0 has been added and support for GDAL < 1.5 has been
|
|
|
|
|
dropped.
|
2012-09-29 11:01:08 +02:00
|
|
|
|
|
2012-12-15 14:29:46 +01:00
|
|
|
|
New tutorials
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------
|
2012-12-15 14:29:46 +01:00
|
|
|
|
|
|
|
|
|
Additions to the docs include a revamped :doc:`Tutorial 3</intro/tutorial03>`
|
|
|
|
|
and a new :doc:`tutorial on testing</intro/tutorial05>`. A new section,
|
|
|
|
|
"Advanced Tutorials", offers :doc:`How to write reusable apps
|
|
|
|
|
</intro/reusable-apps>` as well as a step-by-step guide for new contributors in
|
|
|
|
|
:doc:`Writing your first patch for Django </intro/contributing>`.
|
|
|
|
|
|
2012-04-10 22:49:45 +02:00
|
|
|
|
Minor features
|
2016-01-03 11:56:22 +01:00
|
|
|
|
--------------
|
2012-04-10 22:49:45 +02:00
|
|
|
|
|
|
|
|
|
Django 1.5 also includes several smaller improvements worth noting:
|
|
|
|
|
|
|
|
|
|
* The template engine now interprets ``True``, ``False`` and ``None`` as the
|
|
|
|
|
corresponding Python objects.
|
|
|
|
|
|
2012-04-29 15:37:23 +02:00
|
|
|
|
* :mod:`django.utils.timezone` provides a helper for converting aware
|
2012-04-29 20:33:54 +02:00
|
|
|
|
datetimes between time zones. See :func:`~django.utils.timezone.localtime`.
|
2012-04-29 15:37:23 +02:00
|
|
|
|
|
2012-05-17 14:03:19 +02:00
|
|
|
|
* The generic views support OPTIONS requests.
|
|
|
|
|
|
2012-05-26 20:50:44 +02:00
|
|
|
|
* Management commands do not raise ``SystemExit`` any more when called by code
|
2016-01-13 00:01:29 +01:00
|
|
|
|
from :func:`~django.core.management.call_command`. Any exception raised by
|
|
|
|
|
the command (mostly :exc:`~django.core.management.CommandError`) is
|
|
|
|
|
propagated.
|
2012-05-26 20:50:44 +02:00
|
|
|
|
|
2013-02-09 10:17:26 +01:00
|
|
|
|
Moreover, when you output errors or messages in your custom commands, you
|
|
|
|
|
should now use ``self.stdout.write('message')`` and
|
|
|
|
|
``self.stderr.write('error')`` (see the note on
|
|
|
|
|
:ref:`management commands output <management-commands-output>`).
|
|
|
|
|
|
2018-07-31 17:32:38 +02:00
|
|
|
|
* The :djadmin:`dumpdata` management command outputs one row at a time,
|
|
|
|
|
preventing out-of-memory errors when dumping large datasets.
|
2012-05-26 16:15:45 +02:00
|
|
|
|
|
2012-05-10 22:19:01 +02:00
|
|
|
|
* In the localflavor for Canada, "pq" was added to the acceptable codes for
|
|
|
|
|
Quebec. It's an old abbreviation.
|
|
|
|
|
|
2012-06-08 12:00:51 +02:00
|
|
|
|
* The :ref:`receiver <connecting-receiver-functions>` decorator is now able to
|
|
|
|
|
connect to more than one signal by supplying a list of signals.
|
|
|
|
|
|
2012-09-07 18:42:06 +02:00
|
|
|
|
* In the admin, you can now filter users by groups which they are members of.
|
|
|
|
|
|
2012-04-29 03:22:05 +02:00
|
|
|
|
* :meth:`QuerySet.bulk_create()
|
2012-08-06 23:28:58 +02:00
|
|
|
|
<django.db.models.query.QuerySet.bulk_create>` now has a batch_size
|
2012-04-29 03:22:05 +02:00
|
|
|
|
argument. By default the batch_size is unlimited except for SQLite where
|
|
|
|
|
single batch is limited so that 999 parameters per query isn't exceeded.
|
|
|
|
|
|
2012-09-09 00:55:29 +02:00
|
|
|
|
* The :setting:`LOGIN_URL` and :setting:`LOGIN_REDIRECT_URL` settings now also
|
|
|
|
|
accept view function names and
|
|
|
|
|
:ref:`named URL patterns <naming-url-patterns>`. This allows you to reduce
|
|
|
|
|
configuration duplication. More information can be found in the
|
|
|
|
|
:func:`~django.contrib.auth.decorators.login_required` documentation.
|
|
|
|
|
|
2012-09-24 07:48:13 +02:00
|
|
|
|
* Django now provides a mod_wsgi :doc:`auth handler
|
2012-09-29 21:57:50 +02:00
|
|
|
|
</howto/deployment/wsgi/apache-auth>`.
|
2012-09-24 07:48:13 +02:00
|
|
|
|
|
2012-09-20 17:51:30 +02:00
|
|
|
|
* The :meth:`QuerySet.delete() <django.db.models.query.QuerySet.delete>`
|
|
|
|
|
and :meth:`Model.delete() <django.db.models.Model.delete()>` can now take
|
|
|
|
|
fast-path in some cases. The fast-path allows for less queries and less
|
|
|
|
|
objects fetched into memory. See :meth:`QuerySet.delete()
|
|
|
|
|
<django.db.models.query.QuerySet.delete>` for details.
|
|
|
|
|
|
2015-12-30 16:51:16 +01:00
|
|
|
|
* An instance of ``ResolverMatch`` is stored on the request as
|
|
|
|
|
``resolver_match``.
|
2012-09-27 15:06:58 +02:00
|
|
|
|
|
2013-03-22 10:50:45 +01:00
|
|
|
|
* By default, all logging messages reaching the ``django`` logger when
|
|
|
|
|
:setting:`DEBUG` is ``True`` are sent to the console (unless you redefine the
|
2012-09-26 19:56:21 +02:00
|
|
|
|
logger in your :setting:`LOGGING` setting).
|
|
|
|
|
|
2012-09-30 17:13:23 +02:00
|
|
|
|
* When using :class:`~django.template.RequestContext`, it is now possible to
|
|
|
|
|
look up permissions by using ``{% if 'someapp.someperm' in perms %}``
|
|
|
|
|
in templates.
|
|
|
|
|
|
2012-09-30 23:16:14 +02:00
|
|
|
|
* It's not required any more to have ``404.html`` and ``500.html`` templates in
|
|
|
|
|
the root templates directory. Django will output some basic error messages for
|
2020-05-01 14:37:21 +02:00
|
|
|
|
both situations when those templates are not found. It's still recommended as
|
|
|
|
|
good practice to provide those templates in order to present pretty error
|
|
|
|
|
pages to the user.
|
2012-09-30 23:16:14 +02:00
|
|
|
|
|
2012-07-12 03:43:15 +02:00
|
|
|
|
* :mod:`django.contrib.auth` provides a new signal that is emitted
|
|
|
|
|
whenever a user fails to login successfully. See
|
|
|
|
|
:data:`~django.contrib.auth.signals.user_login_failed`
|
|
|
|
|
|
2016-01-12 02:59:34 +01:00
|
|
|
|
* The new :option:`loaddata --ignorenonexistent` option ignore data for fields
|
|
|
|
|
that no longer exist.
|
2012-09-30 14:34:13 +02:00
|
|
|
|
|
2012-10-06 13:14:11 +02:00
|
|
|
|
* :meth:`~django.test.SimpleTestCase.assertXMLEqual` and
|
|
|
|
|
:meth:`~django.test.SimpleTestCase.assertXMLNotEqual` new assertions allow
|
|
|
|
|
you to test equality for XML content at a semantic level, without caring for
|
|
|
|
|
syntax differences (spaces, attribute order, etc.).
|
|
|
|
|
|
2012-09-09 22:25:06 +02:00
|
|
|
|
* RemoteUserMiddleware now forces logout when the REMOTE_USER header
|
|
|
|
|
disappears during the same browser session.
|
|
|
|
|
|
2012-10-30 21:59:23 +01:00
|
|
|
|
* The :ref:`cache-based session backend <cached-sessions-backend>` can store
|
|
|
|
|
session data in a non-default cache.
|
|
|
|
|
|
2012-11-05 00:41:33 +01:00
|
|
|
|
* Multi-column indexes can now be created on models. Read the
|
|
|
|
|
:attr:`~django.db.models.Options.index_together` documentation for more
|
2012-11-05 00:44:20 +01:00
|
|
|
|
information.
|
2012-11-05 00:41:33 +01:00
|
|
|
|
|
2012-11-17 01:50:50 +01:00
|
|
|
|
* During Django's logging configuration verbose Deprecation warnings are
|
|
|
|
|
enabled and warnings are captured into the logging system. Logged warnings
|
|
|
|
|
are routed through the ``console`` logging handler, which by default requires
|
|
|
|
|
:setting:`DEBUG` to be True for output to be generated. The result is that
|
|
|
|
|
DeprecationWarnings should be printed to the console in development
|
|
|
|
|
environments the way they have been in Python versions < 2.7.
|
|
|
|
|
|
2012-11-17 22:53:31 +01:00
|
|
|
|
* The API for :meth:`django.contrib.admin.ModelAdmin.message_user` method has
|
|
|
|
|
been modified to accept additional arguments adding capabilities similar to
|
|
|
|
|
:func:`django.contrib.messages.add_message`. This is useful for generating
|
|
|
|
|
error messages from admin actions.
|
|
|
|
|
|
2012-11-25 20:39:23 +01:00
|
|
|
|
* The admin's list filters can now be customized per-request thanks to the new
|
|
|
|
|
:meth:`django.contrib.admin.ModelAdmin.get_list_filter` method.
|
|
|
|
|
|
2016-06-02 17:41:49 +02:00
|
|
|
|
.. _backwards-incompatible-1.5:
|
|
|
|
|
|
2012-03-30 11:33:51 +02:00
|
|
|
|
Backwards incompatible changes in 1.5
|
|
|
|
|
=====================================
|
|
|
|
|
|
2012-04-14 08:40:20 +02:00
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
|
|
In addition to the changes outlined in this section, be sure to review the
|
2014-05-30 00:58:12 +02:00
|
|
|
|
:ref:`deprecation plan <deprecation-removed-in-1.5>` for any features that
|
2012-04-29 20:33:54 +02:00
|
|
|
|
have been removed. If you haven't updated your code within the
|
2012-04-14 08:40:20 +02:00
|
|
|
|
deprecation timeline for a given feature, its removal may appear as a
|
|
|
|
|
backwards incompatible change.
|
|
|
|
|
|
2013-02-09 18:17:01 +01:00
|
|
|
|
``ALLOWED_HOSTS`` required in production
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------
|
2013-02-09 18:17:01 +01:00
|
|
|
|
|
|
|
|
|
The new :setting:`ALLOWED_HOSTS` setting validates the request's ``Host``
|
|
|
|
|
header and protects against host-poisoning attacks. This setting is now
|
|
|
|
|
required whenever :setting:`DEBUG` is ``False``, or else
|
|
|
|
|
:meth:`django.http.HttpRequest.get_host()` will raise
|
|
|
|
|
:exc:`~django.core.exceptions.SuspiciousOperation`. For more details see the
|
|
|
|
|
:setting:`full documentation<ALLOWED_HOSTS>` for the new setting.
|
|
|
|
|
|
2012-12-15 13:13:45 +01:00
|
|
|
|
Managers on abstract models
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------
|
2012-12-15 13:13:45 +01:00
|
|
|
|
|
|
|
|
|
Abstract models are able to define a custom manager, and that manager
|
|
|
|
|
:ref:`will be inherited by any concrete models extending the abstract model
|
|
|
|
|
<custom-managers-and-inheritance>`. However, if you try to use the abstract
|
|
|
|
|
model to call a method on the manager, an exception will now be raised.
|
|
|
|
|
Previously, the call would have been permitted, but would have failed as soon
|
|
|
|
|
as any database operation was attempted (usually with a "table does not exist"
|
|
|
|
|
error from the database).
|
|
|
|
|
|
|
|
|
|
If you have functionality on a manager that you have been invoking using
|
|
|
|
|
the abstract class, you should migrate that logic to a Python
|
|
|
|
|
``staticmethod`` or ``classmethod`` on the abstract class.
|
|
|
|
|
|
2012-05-24 13:02:19 +02:00
|
|
|
|
Context in year archive class-based views
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------------------------
|
2012-05-24 13:02:19 +02:00
|
|
|
|
|
|
|
|
|
For consistency with the other date-based generic views,
|
|
|
|
|
:class:`~django.views.generic.dates.YearArchiveView` now passes ``year`` in
|
|
|
|
|
the context as a :class:`datetime.date` rather than a string. If you are
|
|
|
|
|
using ``{{ year }}`` in your templates, you must replace it with ``{{
|
|
|
|
|
year|date:"Y" }}``.
|
|
|
|
|
|
|
|
|
|
``next_year`` and ``previous_year`` were also added in the context. They are
|
|
|
|
|
calculated according to ``allow_empty`` and ``allow_future``.
|
|
|
|
|
|
2012-09-22 11:45:51 +02:00
|
|
|
|
Context in year and month archive class-based views
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------------------------------
|
2012-09-22 11:45:51 +02:00
|
|
|
|
|
|
|
|
|
:class:`~django.views.generic.dates.YearArchiveView` and
|
|
|
|
|
:class:`~django.views.generic.dates.MonthArchiveView` were documented to
|
|
|
|
|
provide a ``date_list`` sorted in ascending order in the context, like their
|
|
|
|
|
function-based predecessors, but it actually was in descending order. In 1.5,
|
|
|
|
|
the documented order was restored. You may want to add (or remove) the
|
|
|
|
|
``reversed`` keyword when you're iterating on ``date_list`` in a template::
|
|
|
|
|
|
|
|
|
|
{% for date in date_list reversed %}
|
|
|
|
|
|
|
|
|
|
:class:`~django.views.generic.dates.ArchiveIndexView` still provides a
|
|
|
|
|
``date_list`` in descending order.
|
|
|
|
|
|
2012-08-18 13:52:05 +02:00
|
|
|
|
Context in TemplateView
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------
|
2012-08-18 13:52:05 +02:00
|
|
|
|
|
|
|
|
|
For consistency with the design of the other generic views,
|
|
|
|
|
:class:`~django.views.generic.base.TemplateView` no longer passes a ``params``
|
|
|
|
|
dictionary into the context, instead passing the variables from the URLconf
|
|
|
|
|
directly into the context.
|
|
|
|
|
|
2012-10-20 14:33:57 +02:00
|
|
|
|
Non-form data in HTTP requests
|
2016-01-03 11:56:22 +01:00
|
|
|
|
------------------------------
|
2012-10-20 14:33:57 +02:00
|
|
|
|
|
|
|
|
|
:attr:`request.POST <django.http.HttpRequest.POST>` will no longer include data
|
|
|
|
|
posted via HTTP requests with non form-specific content-types in the header.
|
|
|
|
|
In prior versions, data posted with content-types other than
|
2020-04-30 11:33:04 +02:00
|
|
|
|
:mimetype:`multipart/form-data` or
|
|
|
|
|
:mimetype:`application/x-www-form-urlencoded` would still end up represented in
|
|
|
|
|
the :attr:`request.POST <django.http.HttpRequest.POST>` attribute. Developers
|
|
|
|
|
wishing to access the raw POST data for these cases, should use the
|
|
|
|
|
:attr:`request.body <django.http.HttpRequest.body>` attribute instead.
|
2012-10-20 14:33:57 +02:00
|
|
|
|
|
2012-12-30 15:19:22 +01:00
|
|
|
|
:data:`~django.core.signals.request_finished` signal
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------------------
|
2012-12-30 15:19:22 +01:00
|
|
|
|
|
|
|
|
|
Django used to send the :data:`~django.core.signals.request_finished` signal
|
|
|
|
|
as soon as the view function returned a response. This interacted badly with
|
|
|
|
|
:ref:`streaming responses <httpresponse-streaming>` that delay content
|
|
|
|
|
generation.
|
|
|
|
|
|
|
|
|
|
This signal is now sent after the content is fully consumed by the WSGI
|
|
|
|
|
gateway. This might be backwards incompatible if you rely on the signal being
|
|
|
|
|
fired before sending the response content to the client. If you do, you should
|
2013-06-03 15:53:04 +02:00
|
|
|
|
consider using :doc:`middleware </topics/http/middleware>` instead.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Some WSGI servers and middleware do not always call ``close`` on the
|
|
|
|
|
response object after handling a request, most notably uWSGI prior to 1.2.6
|
|
|
|
|
and Sentry's error reporting middleware up to 2.0.7. In those cases the
|
|
|
|
|
``request_finished`` signal isn't sent at all. This can result in idle
|
|
|
|
|
connections to database and memcache servers.
|
2012-12-30 15:19:22 +01:00
|
|
|
|
|
2012-05-25 19:03:15 +02:00
|
|
|
|
OPTIONS, PUT and DELETE requests in the test client
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------------------------------
|
2012-05-25 19:03:15 +02:00
|
|
|
|
|
|
|
|
|
Unlike GET and POST, these HTTP methods aren't implemented by web browsers.
|
|
|
|
|
Rather, they're used in APIs, which transfer data in various formats such as
|
|
|
|
|
JSON or XML. Since such requests may contain arbitrary data, Django doesn't
|
|
|
|
|
attempt to decode their body.
|
|
|
|
|
|
|
|
|
|
However, the test client used to build a query string for OPTIONS and DELETE
|
|
|
|
|
requests like for GET, and a request body for PUT requests like for POST. This
|
|
|
|
|
encoding was arbitrary and inconsistent with Django's behavior when it
|
|
|
|
|
receives the requests, so it was removed in Django 1.5.
|
|
|
|
|
|
|
|
|
|
If you were using the ``data`` parameter in an OPTIONS or a DELETE request,
|
|
|
|
|
you must convert it to a query string and append it to the ``path`` parameter.
|
|
|
|
|
|
|
|
|
|
If you were using the ``data`` parameter in a PUT request without a
|
|
|
|
|
``content_type``, you must encode your data before passing it to the test
|
|
|
|
|
client and set the ``content_type`` argument.
|
|
|
|
|
|
2012-08-20 21:21:00 +02:00
|
|
|
|
.. _simplejson-incompatibilities:
|
|
|
|
|
|
2014-10-24 21:35:20 +02:00
|
|
|
|
System version of ``simplejson`` no longer used
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------------------------------
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
|
|
|
|
:ref:`As explained below <simplejson-deprecation>`, Django 1.5 deprecates
|
2012-12-25 15:56:22 +01:00
|
|
|
|
``django.utils.simplejson`` in favor of Python 2.6's built-in :mod:`json`
|
2012-08-20 21:21:00 +02:00
|
|
|
|
module. In theory, this change is harmless. Unfortunately, because of
|
2014-10-24 21:35:20 +02:00
|
|
|
|
incompatibilities between versions of ``simplejson``, it may trigger errors
|
2012-08-20 21:21:00 +02:00
|
|
|
|
in some circumstances.
|
|
|
|
|
|
2012-12-25 15:56:22 +01:00
|
|
|
|
JSON-related features in Django 1.4 always used ``django.utils.simplejson``.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
This module was actually:
|
|
|
|
|
|
2014-10-24 21:35:20 +02:00
|
|
|
|
- A system version of ``simplejson``, if one was available (ie. ``import
|
2012-08-20 21:21:00 +02:00
|
|
|
|
simplejson`` works), if it was more recent than Django's built-in copy or it
|
|
|
|
|
had the C speedups, or
|
|
|
|
|
- The :mod:`json` module from the standard library, if it was available (ie.
|
|
|
|
|
Python 2.6 or greater), or
|
2014-10-24 21:35:20 +02:00
|
|
|
|
- A built-in copy of version 2.0.7 of ``simplejson``.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
|
|
|
|
In Django 1.5, those features use Python's :mod:`json` module, which is based
|
2014-10-24 21:35:20 +02:00
|
|
|
|
on version 2.0.9 of ``simplejson``.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
|
|
|
|
There are no known incompatibilities between Django's copy of version 2.0.7 and
|
|
|
|
|
Python's copy of version 2.0.9. However, there are some incompatibilities
|
2014-10-24 21:35:20 +02:00
|
|
|
|
between other versions of ``simplejson``:
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
2020-04-18 16:46:05 +02:00
|
|
|
|
- While the ``simplejson`` API is documented as always returning Unicode
|
2019-03-27 12:15:53 +01:00
|
|
|
|
strings, the optional C implementation can return a bytestring. This was
|
2012-08-20 21:21:00 +02:00
|
|
|
|
fixed in Python 2.7.
|
2014-10-24 21:35:20 +02:00
|
|
|
|
- ``simplejson.JSONEncoder`` gained a ``namedtuple_as_object`` keyword
|
2012-08-20 21:21:00 +02:00
|
|
|
|
argument in version 2.2.
|
|
|
|
|
|
2019-11-25 16:28:47 +01:00
|
|
|
|
More information on these incompatibilities is available in
|
|
|
|
|
:ticket:`ticket #18023 <18023#comment:10>`.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
2014-10-24 21:35:20 +02:00
|
|
|
|
The net result is that, if you have installed ``simplejson`` and your code
|
2012-08-20 21:21:00 +02:00
|
|
|
|
uses Django's serialization internals directly -- for instance
|
2012-12-29 16:35:12 +01:00
|
|
|
|
``django.core.serializers.json.DjangoJSONEncoder``, the switch from
|
2014-10-24 21:35:20 +02:00
|
|
|
|
``simplejson`` to :mod:`json` could break your code. (In general, changes to
|
2012-08-20 21:21:00 +02:00
|
|
|
|
internals aren't documented; we're making an exception here.)
|
|
|
|
|
|
|
|
|
|
At this point, the maintainers of Django believe that using :mod:`json` from
|
|
|
|
|
the standard library offers the strongest guarantee of backwards-compatibility.
|
|
|
|
|
They recommend to use it from now on.
|
|
|
|
|
|
2012-06-06 10:53:16 +02:00
|
|
|
|
String types of hasher method parameters
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------
|
2012-06-06 10:53:16 +02:00
|
|
|
|
|
|
|
|
|
If you have written a :ref:`custom password hasher <auth_password_storage>`,
|
|
|
|
|
your ``encode()``, ``verify()`` or ``safe_summary()`` methods should accept
|
|
|
|
|
Unicode parameters (``password``, ``salt`` or ``encoded``). If any of the
|
2019-03-27 12:15:53 +01:00
|
|
|
|
hashing methods need bytestrings, you can use the
|
2012-08-28 20:59:56 +02:00
|
|
|
|
:func:`~django.utils.encoding.force_bytes` utility to encode the strings.
|
2012-06-06 10:53:16 +02:00
|
|
|
|
|
2012-06-09 17:55:24 +02:00
|
|
|
|
Validation of previous_page_number and next_page_number
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------------------------------------------------
|
2012-06-09 17:55:24 +02:00
|
|
|
|
|
|
|
|
|
When using :doc:`object pagination </topics/pagination>`,
|
|
|
|
|
the ``previous_page_number()`` and ``next_page_number()`` methods of the
|
|
|
|
|
:class:`~django.core.paginator.Page` object did not check if the returned
|
|
|
|
|
number was inside the existing page range.
|
2012-12-29 16:35:12 +01:00
|
|
|
|
It does check it now and raises an :exc:`~django.core.paginator.InvalidPage`
|
|
|
|
|
exception when the number is either too low or too high.
|
2012-06-09 17:55:24 +02:00
|
|
|
|
|
2012-05-26 22:19:13 +02:00
|
|
|
|
Behavior of autocommit database option on PostgreSQL changed
|
2016-01-03 11:56:22 +01:00
|
|
|
|
------------------------------------------------------------
|
2012-05-26 22:19:13 +02:00
|
|
|
|
|
|
|
|
|
PostgreSQL's autocommit option didn't work as advertised previously. It did
|
|
|
|
|
work for single transaction block, but after the first block was left the
|
|
|
|
|
autocommit behavior was never restored. This bug is now fixed in 1.5. While
|
|
|
|
|
this is only a bug fix, it is worth checking your applications behavior if
|
|
|
|
|
you are using PostgreSQL together with the autocommit option.
|
|
|
|
|
|
2012-07-05 17:09:48 +02:00
|
|
|
|
Session not saved on 500 responses
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------
|
2012-07-05 17:09:48 +02:00
|
|
|
|
|
|
|
|
|
Django's session middleware will skip saving the session data if the
|
|
|
|
|
response's status code is 500.
|
|
|
|
|
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
Email checks on failed admin login
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
|
|
|
|
|
Prior to Django 1.5, if you attempted to log into the admin interface and
|
|
|
|
|
mistakenly used your email address instead of your username, the admin
|
|
|
|
|
interface would provide a warning advising that your email address was
|
|
|
|
|
not your username. In Django 1.5, the introduction of
|
2016-11-23 21:03:33 +01:00
|
|
|
|
:ref:`custom user models <auth-custom-user>` has required the removal of this
|
Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.
Squashed commit of the following:
commit d84749a0f034a0a6906d20df047086b1219040d0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 18:37:04 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 531e7715da545f930c49919a19e954d41c59b446
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Wed Sep 26 07:09:23 2012 +0800
Merged recent trunk changes.
commit 29d1abbe351fd5da855fe5ce09e24227d90ddc91
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:49:46 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8a527dda13c9bec955b1f7e8db5822d1d9b32a01
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 24 07:48:05 2012 +0800
Ensure sequences are reset correctly in the presence of swapped models.
commit e2b6e22f298eb986d74d28b8d9906f37f5ff8eb8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 17:53:05 2012 +0800
Modifications to the handling and docs for auth forms.
commit 98aba856b534620aea9091f824b442b47d2fdb3c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 15:28:57 2012 +0800
Improved error handling and docs for get_user_model()
commit 0229209c844f06dfeb33b0b8eeec000c127695b6
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 23 14:50:11 2012 +0800
Merged recent Django trunk changes.
commit 6494bf91f2ddaaabec3ec017f2e3131937c35517
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 21:38:44 2012 +0800
Improved validation of swappable model settings.
commit 5a04cde342cc860384eb844cfda5af55204564ad
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 17 07:15:14 2012 +0800
Removed some unused imports.
commit ffd535e4136dc54f084b6ac467e81444696e1c8a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:31:28 2012 +0800
Corrected attribute access on for get_by_natural_key
commit 913e1ac84c3d9c7c58a9b3bdbbb15ebccd8a8c0a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 20:12:34 2012 +0800
Added test for proxy model safeguards on swappable models.
commit 280bf19e94d0d534d0e51bae485c1842558f4ff4
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:16:49 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit dbb3900775a99df8b6cb1d7063cf364eab55621a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 18:09:27 2012 +0800
Fixes for Python 3 compatibility.
commit dfd72131d8664615e245aa0f95b82604ba6b3821
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:54:30 2012 +0800
Added protection against proxying swapped models.
commit abcb027190e53613e7f1734e77ee185b2587de31
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 15:11:10 2012 +0800
Cleanup and documentation of AbstractUser base class.
commit a9491a87763e307f0eb0dc246f54ac865a6ffb34
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:46:49 2012 +0800
Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011
commit fd8bb4e3e498a92d7a8b340f0684d5f088aa4c92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 14:20:14 2012 +0800
Documentation improvements coming from community review.
commit b550a6d06d016ab6a0198c4cb2dffe9cceabe8a5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:52:47 2012 +0800
Refactored skipIfCustomUser into the contrib.auth tests.
commit 52a02f11107c3f0d711742b8ca65b75175b79d6a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:46:10 2012 +0800
Refactored common 'get' pattern into manager method.
commit b441a6bbc7d6065175715cb09316b9f13268171b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 16 13:41:33 2012 +0800
Added note about backwards incompatible change to admin login messages.
commit 08bcb4aec1ed154cefc631b8510ee13e9af0c19d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:33 2012 +0300
Splitted User to AbstractUser and User
commit d9f5e5addbad5e1a01f67e7358e4f5091c3cad81
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date: Sat Sep 15 18:30:02 2012 +0300
Reworked REQUIRED_FIELDS + create_user() interaction
commit 579f152e4a6e06671e1ac1e59e2b43cf4d764bf4
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:37 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 918497218c58227f5032873ff97261627b2ceab2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:18:19 2012 +0800
Deprecate AUTH_PROFILE_MODULE and get_profile().
commit 334cdfc1bb6a6794791497cdefda843bca2ea57a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 20:00:12 2012 +0800
Added release notes for new swappable User feature.
commit 5d7bb22e8d913b51aba1c3360e7af8b01b6c0ab6
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 19:59:49 2012 +0800
Ensure swapped models can't be queried.
commit 57ac6e3d32605a67581e875b37ec5b2284711a32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 15 14:31:54 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit f2ec915b20f81c8afeaa3df25f80689712f720f8
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:29:51 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 19526563b54fa300785c49cfb625c0c6158ced67
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 08:22:26 2012 +0800
Merge recent changes from master.
commit 2c5e833a30bef4305d55eacc0703533152f5c427
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 07:53:46 2012 +0800
Corrected admin_views tests following removal of the email fallback on admin logins.
commit 20d1892491839d6ef21f37db4ca136935c2076bf
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sun Sep 9 01:00:37 2012 +0800
Added conditional skips for all tests dependent on the default User model
commit 40ea8b888284775481fc1eaadeff267dbd7e3dfa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:47:02 2012 +0800
Added documentation for REQUIRED_FIELDS in custom auth.
commit e6aaf659708cf6491f5485d3edfa616cb9214cc0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Sat Sep 8 23:20:02 2012 +0800
Added first draft of custom User docs.
Thanks to Greg Turner for the initial text.
commit 75118bd242eec87649da2859e8c50a199a8a1dca
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 11:17:26 2012 +0800
Admin app should not allow username discovery
The admin app login form should not allow users to discover the username
associated with an email address.
commit d088b3af58dad7449fc58493193a327725c57c22
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date: Mon Aug 20 10:32:13 2012 +0800
Admin app login form should use swapped user model
commit 7e82e83d67ee0871a72e1a3a723afdd214fcefc3
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Fri Sep 7 23:45:03 2012 +0800
Merged master changes.
commit e29c010beb96ca07697c4e3e0c0d5d3ffdc4c0a3
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:12:57 2012 +0800
Merge remote-tracking branch 'django/master' into t3011
commit 8e3fd703d02c31a4c3ac9f51f5011d03c0bd47f6
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Aug 20 13:09:09 2012 +0800
Merged recent changes from trunk.
commit 507bb50a9291bfcdcfa1198f9fea21d4e3b1e762
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:41:37 2012 +0800
Modified auth app so that login with alternate auth app is possible.
commit dabe3628362ab7a4a6c9686dd874803baa997eaa
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 20:10:51 2012 +0800
Modified auth management commands to handle custom user definitions.
commit 7cc0baf89d490c92ef3f1dc909b8090191a1294b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Jun 4 14:17:28 2012 +0800
Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 12:48:09 +02:00
|
|
|
|
warning. This doesn't change the login behavior of the admin site; it only
|
|
|
|
|
affects the warning message that is displayed under one particular mode of
|
|
|
|
|
login failure.
|
|
|
|
|
|
2012-07-24 22:24:16 +02:00
|
|
|
|
Changes in tests execution
|
2016-01-03 11:56:22 +01:00
|
|
|
|
--------------------------
|
2012-07-24 22:24:16 +02:00
|
|
|
|
|
|
|
|
|
Some changes have been introduced in the execution of tests that might be
|
|
|
|
|
backward-incompatible for some testing setups:
|
|
|
|
|
|
|
|
|
|
Database flushing in ``django.test.TransactionTestCase``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2012-07-24 22:24:16 +02:00
|
|
|
|
|
|
|
|
|
Previously, the test database was truncated *before* each test run in a
|
|
|
|
|
:class:`~django.test.TransactionTestCase`.
|
|
|
|
|
|
|
|
|
|
In order to be able to run unit tests in any order and to make sure they are
|
|
|
|
|
always isolated from each other, :class:`~django.test.TransactionTestCase` will
|
|
|
|
|
now reset the database *after* each test run instead.
|
|
|
|
|
|
2012-10-25 23:20:55 +02:00
|
|
|
|
No more implicit DB sequences reset
|
2016-01-03 11:56:22 +01:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2012-07-24 22:24:16 +02:00
|
|
|
|
|
|
|
|
|
:class:`~django.test.TransactionTestCase` tests used to reset primary key
|
|
|
|
|
sequences automatically together with the database flushing actions described
|
|
|
|
|
above.
|
|
|
|
|
|
|
|
|
|
This has been changed so no sequences are implicitly reset. This can cause
|
|
|
|
|
:class:`~django.test.TransactionTestCase` tests that depend on hard-coded
|
|
|
|
|
primary key values to break.
|
|
|
|
|
|
|
|
|
|
The new :attr:`~django.test.TransactionTestCase.reset_sequences` attribute can
|
|
|
|
|
be used to force the old behavior for :class:`~django.test.TransactionTestCase`
|
|
|
|
|
that might need it.
|
|
|
|
|
|
|
|
|
|
Ordering of tests
|
2016-01-03 11:56:22 +01:00
|
|
|
|
~~~~~~~~~~~~~~~~~
|
2012-07-24 22:24:16 +02:00
|
|
|
|
|
|
|
|
|
In order to make sure all ``TestCase`` code starts with a clean database,
|
|
|
|
|
tests are now executed in the following order:
|
|
|
|
|
|
2018-07-31 17:32:38 +02:00
|
|
|
|
* First, all unit tests (including :class:`unittest.TestCase`,
|
2012-07-24 22:24:16 +02:00
|
|
|
|
:class:`~django.test.SimpleTestCase`, :class:`~django.test.TestCase` and
|
|
|
|
|
:class:`~django.test.TransactionTestCase`) are run with no particular ordering
|
|
|
|
|
guaranteed nor enforced among them.
|
|
|
|
|
|
|
|
|
|
* Then any other tests (e.g. doctests) that may alter the database without
|
|
|
|
|
restoring it to its original state are run.
|
|
|
|
|
|
|
|
|
|
This should not cause any problems unless you have existing doctests which
|
|
|
|
|
assume a :class:`~django.test.TransactionTestCase` executed earlier left some
|
|
|
|
|
database state behind or unit tests that rely on some form of state being
|
|
|
|
|
preserved after the execution of other tests. Such tests are already very
|
|
|
|
|
fragile, and must now be changed to be able to run independently.
|
|
|
|
|
|
2020-03-31 10:37:38 +02:00
|
|
|
|
``cleaned_data`` dictionary kept for invalid forms
|
|
|
|
|
--------------------------------------------------
|
2012-08-04 14:17:02 +02:00
|
|
|
|
|
|
|
|
|
The :attr:`~django.forms.Form.cleaned_data` dictionary is now always present
|
|
|
|
|
after form validation. When the form doesn't validate, it contains only the
|
|
|
|
|
fields that passed validation. You should test the success of the validation
|
|
|
|
|
with the :meth:`~django.forms.Form.is_valid()` method and not with the
|
|
|
|
|
presence or absence of the :attr:`~django.forms.Form.cleaned_data` attribute
|
|
|
|
|
on the form.
|
|
|
|
|
|
2014-12-26 18:34:26 +01:00
|
|
|
|
Behavior of ``syncdb`` with multiple databases
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------------
|
2012-11-22 20:09:40 +01:00
|
|
|
|
|
2014-12-26 18:34:26 +01:00
|
|
|
|
``syncdb`` now queries the database routers to determine if content
|
2012-11-22 20:09:40 +01:00
|
|
|
|
types (when :mod:`~django.contrib.contenttypes` is enabled) and permissions
|
|
|
|
|
(when :mod:`~django.contrib.auth` is enabled) should be created in the target
|
|
|
|
|
database. Previously, it created them in the default database, even when
|
2016-01-12 02:59:34 +01:00
|
|
|
|
another database was specified with the ``--database`` option.
|
2012-11-22 20:09:40 +01:00
|
|
|
|
|
2014-12-26 18:34:26 +01:00
|
|
|
|
If you use ``syncdb`` on multiple databases, you should ensure that
|
2012-11-22 20:09:40 +01:00
|
|
|
|
your routers allow synchronizing content types and permissions to only one of
|
|
|
|
|
them. See the docs on the :ref:`behavior of contrib apps with multiple
|
|
|
|
|
databases <contrib_app_multiple_databases>` for more information.
|
|
|
|
|
|
2013-02-13 00:06:03 +01:00
|
|
|
|
XML deserializer will not parse documents with a DTD
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------------------------------
|
2013-02-13 00:06:03 +01:00
|
|
|
|
|
|
|
|
|
In order to prevent exposure to denial-of-service attacks related to external
|
|
|
|
|
entity references and entity expansion, the XML model deserializer now refuses
|
|
|
|
|
to parse XML documents containing a DTD (DOCTYPE definition). Since the XML
|
|
|
|
|
serializer does not output a DTD, this will not impact typical usage, only
|
|
|
|
|
cases where custom-created XML documents are passed to Django's model
|
|
|
|
|
deserializer.
|
|
|
|
|
|
|
|
|
|
Formsets default ``max_num``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
----------------------------
|
2013-02-13 00:06:03 +01:00
|
|
|
|
|
|
|
|
|
A (default) value of ``None`` for the ``max_num`` argument to a formset factory
|
|
|
|
|
no longer defaults to allowing any number of forms in the formset. Instead, in
|
|
|
|
|
order to prevent memory-exhaustion attacks, it now defaults to a limit of 1000
|
|
|
|
|
forms. This limit can be raised by explicitly setting a higher value for
|
|
|
|
|
``max_num``.
|
|
|
|
|
|
2012-07-15 21:07:02 +02:00
|
|
|
|
Miscellaneous
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------
|
2012-07-15 21:07:02 +02:00
|
|
|
|
|
2012-10-03 18:50:12 +02:00
|
|
|
|
* :class:`django.forms.ModelMultipleChoiceField` now returns an empty
|
|
|
|
|
``QuerySet`` as the empty value instead of an empty list.
|
|
|
|
|
|
2012-12-25 15:56:22 +01:00
|
|
|
|
* :func:`~django.utils.http.int_to_base36` properly raises a
|
2014-04-26 16:00:15 +02:00
|
|
|
|
:exc:`TypeError` instead of :exc:`ValueError` for non-integer inputs.
|
2012-08-03 18:46:30 +02:00
|
|
|
|
|
2018-10-09 15:26:07 +02:00
|
|
|
|
* The ``slugify`` template filter is now available as a standard Python
|
2012-08-18 14:53:22 +02:00
|
|
|
|
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
|
2015-08-18 16:09:17 +02:00
|
|
|
|
available at ``django.utils.html.remove_tags()``.
|
2012-08-18 14:53:22 +02:00
|
|
|
|
|
2012-09-05 17:05:28 +02:00
|
|
|
|
* Uploaded files are no longer created as executable by default. If you need
|
2012-10-25 23:20:55 +02:00
|
|
|
|
them to be executable change :setting:`FILE_UPLOAD_PERMISSIONS` to your
|
2014-07-26 03:34:13 +02:00
|
|
|
|
needs. The new default value is ``0o666`` (octal) and the current umask value
|
2012-09-05 17:05:28 +02:00
|
|
|
|
is first masked out.
|
|
|
|
|
|
2013-09-06 19:57:25 +02:00
|
|
|
|
* The :class:`F expressions <django.db.models.F>` supported bitwise operators by
|
2012-10-03 17:53:40 +02:00
|
|
|
|
``&`` and ``|``. These operators are now available using ``.bitand()`` and
|
2013-09-06 19:57:25 +02:00
|
|
|
|
``.bitor()`` instead. The removal of ``&`` and ``|`` was done to be
|
|
|
|
|
consistent with :ref:`Q() expressions <complex-lookups-with-q>` and
|
|
|
|
|
``QuerySet`` combining where the operators are used as boolean AND and OR
|
|
|
|
|
operators.
|
2012-10-03 17:53:40 +02:00
|
|
|
|
|
2013-09-06 19:57:25 +02:00
|
|
|
|
* In a ``filter()`` call, when :class:`F expressions <django.db.models.F>`
|
2012-11-22 19:27:28 +01:00
|
|
|
|
contained lookups spanning multi-valued relations, they didn't always reuse
|
|
|
|
|
the same relations as other lookups along the same chain. This was changed,
|
|
|
|
|
and now F() expressions will always use the same relations as other lookups
|
|
|
|
|
within the same ``filter()`` call.
|
|
|
|
|
|
2012-10-13 20:59:58 +02:00
|
|
|
|
* The :ttag:`csrf_token` template tag is no longer enclosed in a div. If you need
|
|
|
|
|
HTML validation against pre-HTML5 Strict DTDs, you should add a div around it
|
|
|
|
|
in your pages.
|
|
|
|
|
|
2012-11-17 22:38:19 +01:00
|
|
|
|
* The template tags library ``adminmedia``, which only contained the
|
|
|
|
|
deprecated template tag ``{% admin_media_prefix %}``, was removed.
|
|
|
|
|
Attempting to load it with ``{% load adminmedia %}`` will fail. If your
|
|
|
|
|
templates still contain that line you must remove it.
|
|
|
|
|
|
2013-02-08 16:32:09 +01:00
|
|
|
|
* Because of an implementation oversight, it was possible to use
|
|
|
|
|
:doc:`django.contrib.redirects </ref/contrib/redirects>` without enabling
|
|
|
|
|
:doc:`django.contrib.sites </ref/contrib/sites>`. This isn't allowed any
|
|
|
|
|
longer. If you're using ``django.contrib.redirects``, make sure
|
2013-02-17 14:33:29 +01:00
|
|
|
|
:setting:`INSTALLED_APPS` contains ``django.contrib.sites``.
|
2013-02-08 16:32:09 +01:00
|
|
|
|
|
2013-04-06 16:04:30 +02:00
|
|
|
|
* :meth:`BoundField.label_tag <django.forms.BoundField.label_tag>` now
|
|
|
|
|
escapes its ``contents`` argument. To avoid the HTML escaping, use
|
|
|
|
|
:func:`django.utils.safestring.mark_safe` on the argument before passing it.
|
|
|
|
|
|
2013-11-18 15:32:25 +01:00
|
|
|
|
* Accessing reverse one-to-one relations fetched via
|
|
|
|
|
:meth:`~django.db.models.query.QuerySet.select_related` now raises
|
2015-05-08 03:30:04 +02:00
|
|
|
|
:exc:`~django.db.models.Model.DoesNotExist` instead of returning ``None``.
|
2013-11-18 15:32:25 +01:00
|
|
|
|
|
2014-02-03 14:09:27 +01:00
|
|
|
|
.. _deprecated-features-1.5:
|
|
|
|
|
|
2012-03-30 11:33:51 +02:00
|
|
|
|
Features deprecated in 1.5
|
|
|
|
|
==========================
|
|
|
|
|
|
2012-12-26 14:19:28 +01:00
|
|
|
|
``django.contrib.localflavor``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
------------------------------
|
2012-12-26 14:19:28 +01:00
|
|
|
|
|
|
|
|
|
The localflavor contrib app has been split into separate packages.
|
2015-03-22 12:51:09 +01:00
|
|
|
|
``django.contrib.localflavor`` itself will be removed in Django 1.6,
|
|
|
|
|
after an accelerated deprecation.
|
2012-12-26 14:19:28 +01:00
|
|
|
|
|
2015-10-21 06:50:20 +02:00
|
|
|
|
The new packages are available on GitHub. The core team cannot
|
2015-03-22 12:51:09 +01:00
|
|
|
|
efficiently maintain these packages in the long term — it spans just a
|
|
|
|
|
dozen countries at this time; similar to translations, maintenance
|
2012-12-26 14:19:28 +01:00
|
|
|
|
will be handed over to interested members of the community.
|
|
|
|
|
|
|
|
|
|
``django.contrib.markup``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-------------------------
|
2012-12-26 14:19:28 +01:00
|
|
|
|
|
|
|
|
|
The markup contrib module has been deprecated and will follow an accelerated
|
2015-06-05 14:24:53 +02:00
|
|
|
|
deprecation schedule. Direct use of Python markup libraries or 3rd party tag
|
2012-12-26 14:19:28 +01:00
|
|
|
|
libraries is preferred to Django maintaining this functionality in the
|
|
|
|
|
framework.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
2013-06-28 20:13:06 +02:00
|
|
|
|
``AUTH_PROFILE_MODULE``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------
|
2012-10-23 22:25:38 +02:00
|
|
|
|
|
2016-11-23 21:03:33 +01:00
|
|
|
|
With the introduction of :ref:`custom user models <auth-custom-user>`, there is
|
2012-10-23 22:25:38 +02:00
|
|
|
|
no longer any need for a built-in mechanism to store user profile data.
|
|
|
|
|
|
|
|
|
|
You can still define user profiles models that have a one-to-one relation with
|
|
|
|
|
the User model - in fact, for many applications needing to associate data with
|
|
|
|
|
a User account, this will be an appropriate design pattern to follow. However,
|
2013-06-28 20:13:06 +02:00
|
|
|
|
the ``AUTH_PROFILE_MODULE`` setting, and the
|
|
|
|
|
``django.contrib.auth.models.User.get_profile()`` method for accessing
|
2012-10-23 22:25:38 +02:00
|
|
|
|
the user profile model, should not be used any longer.
|
|
|
|
|
|
2012-12-25 15:56:22 +01:00
|
|
|
|
Streaming behavior of :class:`~django.http.HttpResponse`
|
2016-01-03 11:56:22 +01:00
|
|
|
|
--------------------------------------------------------
|
2012-10-23 22:25:38 +02:00
|
|
|
|
|
|
|
|
|
Django 1.5 deprecates the ability to stream a response by passing an iterator
|
|
|
|
|
to :class:`~django.http.HttpResponse`. If you rely on this behavior, switch to
|
2012-10-25 23:20:55 +02:00
|
|
|
|
:class:`~django.http.StreamingHttpResponse`. See
|
|
|
|
|
:ref:`explicit-streaming-responses` above.
|
2012-10-23 22:25:38 +02:00
|
|
|
|
|
|
|
|
|
In Django 1.7 and above, the iterator will be consumed immediately by
|
|
|
|
|
:class:`~django.http.HttpResponse`.
|
|
|
|
|
|
2012-12-26 14:19:28 +01:00
|
|
|
|
.. _simplejson-deprecation:
|
|
|
|
|
|
2012-04-29 19:58:00 +02:00
|
|
|
|
``django.utils.simplejson``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------
|
2012-04-29 19:58:00 +02:00
|
|
|
|
|
2012-04-29 20:33:54 +02:00
|
|
|
|
Since Django 1.5 drops support for Python 2.5, we can now rely on the
|
2012-08-20 21:21:00 +02:00
|
|
|
|
:mod:`json` module being available in Python's standard library, so we've
|
2014-10-24 21:35:20 +02:00
|
|
|
|
removed our own copy of ``simplejson``. You should now import :mod:`json`
|
2012-12-25 15:56:22 +01:00
|
|
|
|
instead of ``django.utils.simplejson``.
|
2012-08-20 21:21:00 +02:00
|
|
|
|
|
|
|
|
|
Unfortunately, this change might have unwanted side-effects, because of
|
2014-10-24 21:35:20 +02:00
|
|
|
|
incompatibilities between versions of ``simplejson`` -- see the
|
2012-08-20 21:21:00 +02:00
|
|
|
|
:ref:`backwards-incompatible changes <simplejson-incompatibilities>` section.
|
2014-10-24 21:35:20 +02:00
|
|
|
|
If you rely on features added to ``simplejson`` after it became Python's
|
|
|
|
|
:mod:`json`, you should import ``simplejson`` explicitly.
|
2012-04-29 19:58:00 +02:00
|
|
|
|
|
2012-08-12 14:39:48 +02:00
|
|
|
|
``django.utils.encoding.StrAndUnicode``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------------------
|
2012-08-12 14:39:48 +02:00
|
|
|
|
|
2013-06-29 04:05:00 +02:00
|
|
|
|
The ``django.utils.encoding.StrAndUnicode`` mix-in has been deprecated.
|
2012-08-12 14:39:48 +02:00
|
|
|
|
Define a ``__str__`` method and apply the
|
2019-02-05 01:53:27 +01:00
|
|
|
|
``django.utils.encoding.python_2_unicode_compatible`` decorator instead.
|
2012-06-23 16:57:20 +02:00
|
|
|
|
|
2012-10-23 22:25:38 +02:00
|
|
|
|
``django.utils.itercompat.product``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
-----------------------------------
|
2012-10-23 22:25:38 +02:00
|
|
|
|
|
2012-12-29 16:35:12 +01:00
|
|
|
|
The ``django.utils.itercompat.product`` function has been deprecated. Use
|
2012-10-23 22:25:38 +02:00
|
|
|
|
the built-in :func:`itertools.product` instead.
|
|
|
|
|
|
2012-10-27 11:49:46 +02:00
|
|
|
|
``cleanup`` management command
|
2016-01-03 11:56:22 +01:00
|
|
|
|
------------------------------
|
2012-10-27 11:49:46 +02:00
|
|
|
|
|
2013-06-28 18:38:04 +02:00
|
|
|
|
The ``cleanup`` management command has been deprecated and replaced by
|
2012-10-27 11:49:46 +02:00
|
|
|
|
:djadmin:`clearsessions`.
|
|
|
|
|
|
|
|
|
|
``daily_cleanup.py`` script
|
2016-01-03 11:56:22 +01:00
|
|
|
|
---------------------------
|
2012-10-27 11:49:46 +02:00
|
|
|
|
|
|
|
|
|
The undocumented ``daily_cleanup.py`` script has been deprecated. Use the
|
|
|
|
|
:djadmin:`clearsessions` management command instead.
|
2012-11-02 16:49:29 +01:00
|
|
|
|
|
|
|
|
|
``depth`` keyword argument in ``select_related``
|
2016-01-03 11:56:22 +01:00
|
|
|
|
------------------------------------------------
|
2012-11-02 16:49:29 +01:00
|
|
|
|
|
|
|
|
|
The ``depth`` keyword argument in
|
|
|
|
|
:meth:`~django.db.models.query.QuerySet.select_related` has been deprecated.
|
|
|
|
|
You should use field names instead.
|