<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Django 1.3 release notes — Django 1.5.8 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.5.8', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="top" title="Django 1.5.8 documentation" href="../index.html" /> <link rel="up" title="Release notes" href="index.html" /> <link rel="next" title="Django 1.2.7 release notes" href="1.2.7.html" /> <link rel="prev" title="Django 1.3.1 release notes" href="1.3.1.html" /> <script type="text/javascript" src="../templatebuiltins.js"></script> <script type="text/javascript"> (function($) { if (!django_template_builtins) { // templatebuiltins.js missing, do nothing. return; } $(document).ready(function() { // Hyperlink Django template tags and filters var base = "../ref/templates/builtins.html"; if (base == "#") { // Special case for builtins.html itself base = ""; } // Tags are keywords, class '.k' $("div.highlight\\-html\\+django span.k").each(function(i, elem) { var tagname = $(elem).text(); if ($.inArray(tagname, django_template_builtins.ttags) != -1) { var fragment = tagname.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>"); } }); // Filters are functions, class '.nf' $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { var filtername = $(elem).text(); if ($.inArray(filtername, django_template_builtins.tfilters) != -1) { var fragment = filtername.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>"); } }); }); })(jQuery); </script> </head> <body> <div class="document"> <div id="custom-doc" class="yui-t6"> <div id="hd"> <h1><a href="../index.html">Django 1.5.8 documentation</a></h1> <div id="global-nav"> <a title="Home page" href="../index.html">Home</a> | <a title="Table of contents" href="../contents.html">Table of contents</a> | <a title="Global index" href="../genindex.html">Index</a> | <a title="Module index" href="../py-modindex.html">Modules</a> </div> <div class="nav"> « <a href="1.3.1.html" title="Django 1.3.1 release notes">previous</a> | <a href="index.html" title="Release notes" accesskey="U">up</a> | <a href="1.2.7.html" title="Django 1.2.7 release notes">next</a> »</div> </div> <div id="bd"> <div id="yui-main"> <div class="yui-b"> <div class="yui-g" id="releases-1.3"> <div class="section" id="s-django-1-3-release-notes"> <span id="django-1-3-release-notes"></span><h1>Django 1.3 release notes<a class="headerlink" href="#django-1-3-release-notes" title="Permalink to this headline">¶</a></h1> <p><em>March 23, 2011</em></p> <p>Welcome to Django 1.3!</p> <p>Nearly a year in the making, Django 1.3 includes quite a few <a class="reference internal" href="#what-s-new-in-django-1-3">new features</a> and plenty of bug fixes and improvements to existing features. These release notes cover the new features in 1.3, as well as some <a class="reference internal" href="#backwards-incompatible-changes-1-3">backwards-incompatible changes</a> you’ll want to be aware of when upgrading from Django 1.2 or older versions.</p> <div class="section" id="s-overview"> <span id="overview"></span><h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2> <p>Django 1.3’s focus has mostly been on resolving smaller, long-standing feature requests, but that hasn’t prevented a few fairly significant new features from landing, including:</p> <ul class="simple"> <li>A framework for writing <a class="reference internal" href="#class-based-views">class-based views</a>.</li> <li>Built-in support for <a class="reference internal" href="#logging">using Python’s logging facilities</a>.</li> <li>Contrib support for <a class="reference internal" href="#extended-static-files-handling">easy handling of static files</a>.</li> <li>Django’s testing framework now supports (and ships with a copy of) <a class="reference internal" href="#unittest2-support">the unittest2 library</a>.</li> </ul> <p>There’s plenty more, of course; see the coverage of <a class="reference internal" href="#what-s-new-in-django-1-3">new features</a> below for a full rundown and details.</p> <p>Wherever possible, of course, new features are introduced in a backwards-compatible manner per <a class="reference internal" href="../misc/api-stability.html"><em>our API stability policy</em></a> policy. As a result of this policy, Django 1.3 <a class="reference internal" href="#deprecated-features-1-3">begins the deprecation process for some features</a>.</p> <p>Some changes, unfortunately, are genuinely backwards-incompatible; in most cases these are due to security issues or bugs which simply couldn’t be fixed any other way. Django 1.3 includes a few of these, and descriptions of them – along with the (minor) modifications you’ll need to make to handle them – are documented in the list of <a class="reference internal" href="#backwards-incompatible-changes-1-3">backwards-incompatible changes</a> below.</p> </div> <div class="section" id="s-python-compatibility"> <span id="python-compatibility"></span><h2>Python compatibility<a class="headerlink" href="#python-compatibility" title="Permalink to this headline">¶</a></h2> <p>The release of Django 1.2 was notable for having the first shift in Django’s Python compatibility policy; prior to Django 1.2, Django supported any 2.x version of Python from 2.3 up. As of Django 1.2, the minimum requirement was raised to Python 2.4.</p> <p>Django 1.3 continues to support Python 2.4, but will be the final Django release series to do so; beginning with Django 1.4, the minimum supported Python version will be 2.5. A document outlining our full timeline for deprecating Python 2.x and moving to Python 3.x will be published shortly after the release of Django 1.3.</p> </div> <div class="section" id="s-what-s-new-in-django-1-3"> <span id="what-s-new-in-django-1-3"></span><h2>What’s new in Django 1.3<a class="headerlink" href="#what-s-new-in-django-1-3" title="Permalink to this headline">¶</a></h2> <div class="section" id="s-class-based-views"> <span id="class-based-views"></span><h3>Class-based views<a class="headerlink" href="#class-based-views" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 adds a framework that allows you to use a class as a view. This means you can compose a view out of a collection of methods that can be subclassed and overridden to provide common views of data without having to write too much code.</p> <p>Analogs of all the old function-based generic views have been provided, along with a completely generic view base class that can be used as the basis for reusable applications that can be easily extended.</p> <p>See <a class="reference internal" href="../topics/class-based-views/index.html"><em>the documentation on class-based generic views</em></a> for more details. There is also a document to help you <a class="reference external" href="https://docs.djangoproject.com/en/1.4/topics/generic-views-migration/">convert your function-based generic views to class-based views</a>.</p> </div> <div class="section" id="s-logging"> <span id="logging"></span><h3>Logging<a class="headerlink" href="#logging" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 adds framework-level support for Python’s <tt class="docutils literal"><span class="pre">logging</span></tt> module. This means you can now easily configure and control logging as part of your Django project. A number of logging handlers and logging calls have been added to Django’s own code as well – most notably, the error emails sent on a HTTP 500 server error are now handled as a logging activity. See <a class="reference internal" href="../topics/logging.html"><em>the documentation on Django’s logging interface</em></a> for more details.</p> </div> <div class="section" id="s-extended-static-files-handling"> <span id="extended-static-files-handling"></span><h3>Extended static files handling<a class="headerlink" href="#extended-static-files-handling" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 ships with a new contrib app – <tt class="docutils literal"><span class="pre">django.contrib.staticfiles</span></tt> – to help developers handle the static media files (images, CSS, Javascript, etc.) that are needed to render a complete web page.</p> <p>In previous versions of Django, it was common to place static assets in <a class="reference internal" href="../ref/settings.html#std:setting-MEDIA_ROOT"><tt class="xref std std-setting docutils literal"><span class="pre">MEDIA_ROOT</span></tt></a> along with user-uploaded files, and serve them both at <a class="reference internal" href="../ref/settings.html#std:setting-MEDIA_URL"><tt class="xref std std-setting docutils literal"><span class="pre">MEDIA_URL</span></tt></a>. Part of the purpose of introducing the <tt class="docutils literal"><span class="pre">staticfiles</span></tt> app is to make it easier to keep static files separate from user-uploaded files. Static assets should now go in <tt class="docutils literal"><span class="pre">static/</span></tt> subdirectories of your apps or in other static assets directories listed in <a class="reference internal" href="../ref/contrib/staticfiles.html#std:setting-STATICFILES_DIRS"><tt class="xref std std-setting docutils literal"><span class="pre">STATICFILES_DIRS</span></tt></a>, and will be served at <a class="reference internal" href="../ref/settings.html#std:setting-STATIC_URL"><tt class="xref std std-setting docutils literal"><span class="pre">STATIC_URL</span></tt></a>.</p> <p>See the <a class="reference internal" href="../ref/contrib/staticfiles.html"><em>reference documentation of the app</em></a> for more details or learn how to <a class="reference internal" href="../howto/static-files/index.html"><em>manage static files</em></a>.</p> </div> <div class="section" id="s-unittest2-support"> <span id="unittest2-support"></span><h3>unittest2 support<a class="headerlink" href="#unittest2-support" title="Permalink to this headline">¶</a></h3> <p>Python 2.7 introduced some major changes to the <tt class="docutils literal"><span class="pre">unittest</span></tt> library, adding some extremely useful features. To ensure that every Django project can benefit from these new features, Django ships with a copy of <a class="reference external" href="http://pypi.python.org/pypi/unittest2">unittest2</a>, a copy of the Python 2.7 unittest library, backported for Python 2.4 compatibility.</p> <p>To access this library, Django provides the <tt class="docutils literal"><span class="pre">django.utils.unittest</span></tt> module alias. If you are using Python 2.7, or you have installed <tt class="docutils literal"><span class="pre">unittest2</span></tt> locally, Django will map the alias to the installed version of the unittest library. Otherwise, Django will use its own bundled version of unittest2.</p> <p>To take advantage of this alias, simply use:</p> <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">django.utils</span> <span class="kn">import</span> <span class="n">unittest</span> </pre></div> </div> <p>wherever you would have historically used:</p> <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">unittest</span> </pre></div> </div> <p>If you want to continue to use the base unittest library, you can – you just won’t get any of the nice new unittest2 features.</p> </div> <div class="section" id="s-transaction-context-managers"> <span id="transaction-context-managers"></span><h3>Transaction context managers<a class="headerlink" href="#transaction-context-managers" title="Permalink to this headline">¶</a></h3> <p>Users of Python 2.5 and above may now use <a class="reference internal" href="../topics/db/transactions.html#transaction-management-functions"><em>transaction management functions</em></a> as <a class="reference external" href="http://docs.python.org/glossary.html#term-context-manager">context managers</a>. For example:</p> <div class="highlight-python"><pre>with transaction.autocommit(): # ...</pre> </div> <p>For more information, see <a class="reference internal" href="../topics/db/transactions.html#transaction-management-functions"><em>Controlling transaction management in views</em></a>.</p> </div> <div class="section" id="s-configurable-delete-cascade"> <span id="configurable-delete-cascade"></span><h3>Configurable delete-cascade<a class="headerlink" href="#configurable-delete-cascade" title="Permalink to this headline">¶</a></h3> <p><a class="reference internal" href="../ref/models/fields.html#django.db.models.ForeignKey" title="django.db.models.ForeignKey"><tt class="xref py py-class docutils literal"><span class="pre">ForeignKey</span></tt></a> and <a class="reference internal" href="../ref/models/fields.html#django.db.models.OneToOneField" title="django.db.models.OneToOneField"><tt class="xref py py-class docutils literal"><span class="pre">OneToOneField</span></tt></a> now accept an <a class="reference internal" href="../ref/models/fields.html#django.db.models.ForeignKey.on_delete" title="django.db.models.ForeignKey.on_delete"><tt class="xref py py-attr docutils literal"><span class="pre">on_delete</span></tt></a> argument to customize behavior when the referenced object is deleted. Previously, deletes were always cascaded; available alternatives now include set null, set default, set to any value, protect, or do nothing.</p> <p>For more information, see the <a class="reference internal" href="../ref/models/fields.html#django.db.models.ForeignKey.on_delete" title="django.db.models.ForeignKey.on_delete"><tt class="xref py py-attr docutils literal"><span class="pre">on_delete</span></tt></a> documentation.</p> </div> <div class="section" id="s-contextual-markers-and-comments-for-translatable-strings"> <span id="contextual-markers-and-comments-for-translatable-strings"></span><h3>Contextual markers and comments for translatable strings<a class="headerlink" href="#contextual-markers-and-comments-for-translatable-strings" title="Permalink to this headline">¶</a></h3> <p>For translation strings with ambiguous meaning, you can now use the <tt class="docutils literal"><span class="pre">pgettext</span></tt> function to specify the context of the string.</p> <p>And if you just want to add some information for translators, you can also add special translator comments in the source.</p> <p>For more information, see <a class="reference internal" href="../topics/i18n/translation.html#contextual-markers"><em>Contextual markers</em></a> and <a class="reference internal" href="../topics/i18n/translation.html#translator-comments"><em>Comments for translators</em></a>.</p> </div> <div class="section" id="s-improvements-to-built-in-template-tags"> <span id="improvements-to-built-in-template-tags"></span><h3>Improvements to built-in template tags<a class="headerlink" href="#improvements-to-built-in-template-tags" title="Permalink to this headline">¶</a></h3> <p>A number of improvements have been made to Django’s built-in template tags:</p> <ul class="simple"> <li>The <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-include"><tt class="xref std std-ttag docutils literal"><span class="pre">include</span></tt></a> tag now accepts a <tt class="docutils literal"><span class="pre">with</span></tt> option, allowing you to specify context variables to the included template</li> <li>The <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-include"><tt class="xref std std-ttag docutils literal"><span class="pre">include</span></tt></a> tag now accepts an <tt class="docutils literal"><span class="pre">only</span></tt> option, allowing you to exclude the current context from the included context</li> <li>The <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-with"><tt class="xref std std-ttag docutils literal"><span class="pre">with</span></tt></a> tag now allows you to define multiple context variables in a single <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-with"><tt class="xref std std-ttag docutils literal"><span class="pre">with</span></tt></a> block.</li> <li>The <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-load"><tt class="xref std std-ttag docutils literal"><span class="pre">load</span></tt></a> tag now accepts a <tt class="docutils literal"><span class="pre">from</span></tt> argument, allowing you to load a single tag or filter from a library.</li> </ul> </div> <div class="section" id="s-templateresponse"> <span id="templateresponse"></span><h3>TemplateResponse<a class="headerlink" href="#templateresponse" title="Permalink to this headline">¶</a></h3> <p>It can sometimes be beneficial to allow decorators or middleware to modify a response <em>after</em> it has been constructed by the view. For example, you may want to change the template that is used, or put additional data into the context.</p> <p>However, you can’t (easily) modify the content of a basic <a class="reference internal" href="../ref/request-response.html#django.http.HttpResponse" title="django.http.HttpResponse"><tt class="xref py py-class docutils literal"><span class="pre">HttpResponse</span></tt></a> after it has been constructed. To overcome this limitation, Django 1.3 adds a new <a class="reference internal" href="../ref/template-response.html#django.template.response.TemplateResponse" title="django.template.response.TemplateResponse"><tt class="xref py py-class docutils literal"><span class="pre">TemplateResponse</span></tt></a> class. Unlike basic <a class="reference internal" href="../ref/request-response.html#django.http.HttpResponse" title="django.http.HttpResponse"><tt class="xref py py-class docutils literal"><span class="pre">HttpResponse</span></tt></a> objects, <a class="reference internal" href="../ref/template-response.html#django.template.response.TemplateResponse" title="django.template.response.TemplateResponse"><tt class="xref py py-class docutils literal"><span class="pre">TemplateResponse</span></tt></a> objects retain the details of the template and context that was provided by the view to compute the response. The final output of the response is not computed until it is needed, later in the response process.</p> <p>For more details, see the <a class="reference internal" href="../ref/template-response.html"><em>documentation</em></a> on the <a class="reference internal" href="../ref/template-response.html#django.template.response.TemplateResponse" title="django.template.response.TemplateResponse"><tt class="xref py py-class docutils literal"><span class="pre">TemplateResponse</span></tt></a> class.</p> </div> <div class="section" id="s-caching-changes"> <span id="caching-changes"></span><h3>Caching changes<a class="headerlink" href="#caching-changes" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 sees the introduction of several improvements to the Django’s caching infrastructure.</p> <p>Firstly, Django now supports multiple named caches. In the same way that Django 1.2 introduced support for multiple database connections, Django 1.3 allows you to use the new <a class="reference internal" href="../ref/settings.html#std:setting-CACHES"><tt class="xref std std-setting docutils literal"><span class="pre">CACHES</span></tt></a> setting to define multiple named cache connections.</p> <p>Secondly, <a class="reference internal" href="../topics/cache.html#cache-versioning"><em>versioning</em></a>, <a class="reference internal" href="../topics/cache.html#cache-key-prefixing"><em>site-wide prefixing</em></a> and <a class="reference internal" href="../topics/cache.html#cache-key-transformation"><em>transformation</em></a> have been added to the cache API.</p> <p>Thirdly, <a class="reference internal" href="../topics/cache.html#using-vary-headers"><em>cache key creation</em></a> has been updated to take the request query string into account on <tt class="docutils literal"><span class="pre">GET</span></tt> requests.</p> <p>Finally, support for <a class="reference external" href="http://sendapatch.se/projects/pylibmc/">pylibmc</a> has been added to the memcached cache backend.</p> <p>For more details, see the <a class="reference internal" href="../topics/cache.html"><em>documentation on caching in Django</em></a>.</p> </div> <div class="section" id="s-permissions-for-inactive-users"> <span id="permissions-for-inactive-users"></span><h3>Permissions for inactive users<a class="headerlink" href="#permissions-for-inactive-users" title="Permalink to this headline">¶</a></h3> <p>If you provide a custom auth backend with <tt class="docutils literal"><span class="pre">supports_inactive_user</span></tt> set to <tt class="docutils literal"><span class="pre">True</span></tt>, an inactive <tt class="docutils literal"><span class="pre">User</span></tt> instance will check the backend for permissions. This is useful for further centralizing the permission handling. See the <a class="reference internal" href="../topics/auth/index.html"><em>authentication docs</em></a> for more details.</p> </div> <div class="section" id="s-geodjango"> <span id="geodjango"></span><h3>GeoDjango<a class="headerlink" href="#geodjango" title="Permalink to this headline">¶</a></h3> <p>The GeoDjango test suite is now included when <a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests"><em>running the Django test suite</em></a> with <tt class="docutils literal"><span class="pre">runtests.py</span></tt> when using <a class="reference internal" href="../ref/contrib/gis/db-api.html#spatial-backends"><em>spatial database backends</em></a>.</p> </div> <div class="section" id="s-media-url-and-static-url-must-end-in-a-slash"> <span id="media-url-and-static-url-must-end-in-a-slash"></span><h3><a class="reference internal" href="../ref/settings.html#std:setting-MEDIA_URL"><tt class="xref std std-setting docutils literal"><span class="pre">MEDIA_URL</span></tt></a> and <a class="reference internal" href="../ref/settings.html#std:setting-STATIC_URL"><tt class="xref std std-setting docutils literal"><span class="pre">STATIC_URL</span></tt></a> must end in a slash<a class="headerlink" href="#media-url-and-static-url-must-end-in-a-slash" title="Permalink to this headline">¶</a></h3> <p>Previously, the <a class="reference internal" href="../ref/settings.html#std:setting-MEDIA_URL"><tt class="xref std std-setting docutils literal"><span class="pre">MEDIA_URL</span></tt></a> setting only required a trailing slash if it contained a suffix beyond the domain name.</p> <p>A trailing slash is now <em>required</em> for <a class="reference internal" href="../ref/settings.html#std:setting-MEDIA_URL"><tt class="xref std std-setting docutils literal"><span class="pre">MEDIA_URL</span></tt></a> and the new <a class="reference internal" href="../ref/settings.html#std:setting-STATIC_URL"><tt class="xref std std-setting docutils literal"><span class="pre">STATIC_URL</span></tt></a> setting as long as it is not blank. This ensures there is a consistent way to combine paths in templates.</p> <p>Project settings which provide either of both settings without a trailing slash will now raise a <tt class="docutils literal"><span class="pre">PendingDeprecationWarning</span></tt>.</p> <p>In Django 1.4 this same condition will raise <tt class="docutils literal"><span class="pre">DeprecationWarning</span></tt>, and in Django 1.5 will raise an <tt class="docutils literal"><span class="pre">ImproperlyConfigured</span></tt> exception.</p> </div> <div class="section" id="s-everything-else"> <span id="everything-else"></span><h3>Everything else<a class="headerlink" href="#everything-else" title="Permalink to this headline">¶</a></h3> <p>Django <a class="reference internal" href="1.1.html"><em>1.1</em></a> and <a class="reference internal" href="1.2.html"><em>1.2</em></a> added lots of big ticket items to Django, like multiple-database support, model validation, and a session-based messages framework. However, this focus on big features came at the cost of lots of smaller features.</p> <p>To compensate for this, the focus of the Django 1.3 development process has been on adding lots of smaller, long standing feature requests. These include:</p> <ul class="simple"> <li>Improved tools for accessing and manipulating the current <a class="reference internal" href="../ref/contrib/sites.html#django.contrib.sites.models.Site" title="django.contrib.sites.models.Site"><tt class="xref py py-class docutils literal"><span class="pre">Site</span></tt></a> object in <a class="reference internal" href="../ref/contrib/sites.html"><em>the sites framework</em></a>.</li> <li>A <a class="reference internal" href="../topics/testing/advanced.html#django.test.client.RequestFactory" title="django.test.client.RequestFactory"><tt class="xref py py-class docutils literal"><span class="pre">RequestFactory</span></tt></a> for mocking requests in tests.</li> <li>A new test assertion – <a class="reference internal" href="../topics/testing/overview.html#django.test.TestCase.assertNumQueries" title="django.test.TestCase.assertNumQueries"><tt class="xref py py-meth docutils literal"><span class="pre">assertNumQueries()</span></tt></a> – making it easier to test the database activity associated with a view.</li> <li>Support for lookups spanning relations in admin’s <a class="reference internal" href="../ref/contrib/admin/index.html#django.contrib.admin.ModelAdmin.list_filter" title="django.contrib.admin.ModelAdmin.list_filter"><tt class="xref py py-attr docutils literal"><span class="pre">list_filter</span></tt></a>.</li> <li>Support for <a class="reference external" href="https://www.owasp.org/index.php/HTTPOnly">HTTPOnly</a> cookies.</li> <li><a class="reference internal" href="../topics/email.html#django.core.mail.mail_admins" title="django.core.mail.mail_admins"><tt class="xref py py-meth docutils literal"><span class="pre">mail_admins()</span></tt></a> and <a class="reference internal" href="../topics/email.html#django.core.mail.mail_managers" title="django.core.mail.mail_managers"><tt class="xref py py-meth docutils literal"><span class="pre">mail_managers()</span></tt></a> now support easily attaching HTML content to messages.</li> <li><a class="reference internal" href="../topics/email.html#django.core.mail.EmailMessage" title="django.core.mail.EmailMessage"><tt class="xref py py-class docutils literal"><span class="pre">EmailMessage</span></tt></a> now supports CC’s.</li> <li>Error emails now include more of the detail and formatting of the debug server error page.</li> <li><a class="reference internal" href="../howto/custom-template-tags.html#django.template.Library.simple_tag" title="django.template.Library.simple_tag"><tt class="xref py py-meth docutils literal"><span class="pre">simple_tag()</span></tt></a> now accepts a <tt class="docutils literal"><span class="pre">takes_context</span></tt> argument, making it easier to write simple template tags that require access to template context.</li> <li>A new <a class="reference internal" href="../topics/http/shortcuts.html#django.shortcuts.render" title="django.shortcuts.render"><tt class="xref py py-meth docutils literal"><span class="pre">render()</span></tt></a> shortcut – an alternative to <a class="reference internal" href="../topics/http/shortcuts.html#django.shortcuts.render_to_response" title="django.shortcuts.render_to_response"><tt class="xref py py-meth docutils literal"><span class="pre">render_to_response()</span></tt></a> providing a <a class="reference internal" href="../ref/templates/api.html#django.template.RequestContext" title="django.template.RequestContext"><tt class="xref py py-class docutils literal"><span class="pre">RequestContext</span></tt></a> by default.</li> <li>Support for combining <a class="reference internal" href="../topics/db/queries.html#query-expressions"><em>F() expressions</em></a> with timedelta values when retrieving or updating database values.</li> </ul> </div> </div> <div class="section" id="s-backwards-incompatible-changes-in-1-3"> <span id="s-backwards-incompatible-changes-1-3"></span><span id="backwards-incompatible-changes-in-1-3"></span><span id="backwards-incompatible-changes-1-3"></span><h2>Backwards-incompatible changes in 1.3<a class="headerlink" href="#backwards-incompatible-changes-in-1-3" title="Permalink to this headline">¶</a></h2> <div class="section" id="s-csrf-validation-now-applies-to-ajax-requests"> <span id="csrf-validation-now-applies-to-ajax-requests"></span><h3>CSRF validation now applies to AJAX requests<a class="headerlink" href="#csrf-validation-now-applies-to-ajax-requests" title="Permalink to this headline">¶</a></h3> <p>Prior to Django 1.2.5, Django’s CSRF-prevention system exempted AJAX requests from CSRF verification; due to <a class="reference external" href="https://www.djangoproject.com/weblog/2011/feb/08/security/">security issues</a> reported to us, however, <em>all</em> requests are now subjected to CSRF verification. Consult <a class="reference internal" href="../ref/contrib/csrf.html"><em>the Django CSRF documentation</em></a> for details on how to handle CSRF verification in AJAX requests.</p> </div> <div class="section" id="s-restricted-filters-in-admin-interface"> <span id="restricted-filters-in-admin-interface"></span><h3>Restricted filters in admin interface<a class="headerlink" href="#restricted-filters-in-admin-interface" title="Permalink to this headline">¶</a></h3> <p>Prior to Django 1.2.5, the Django administrative interface allowed filtering on any model field or relation – not just those specified in <tt class="docutils literal"><span class="pre">list_filter</span></tt> – via query string manipulation. Due to security issues reported to us, however, query string lookup arguments in the admin must be for fields or relations specified in <tt class="docutils literal"><span class="pre">list_filter</span></tt> or <tt class="docutils literal"><span class="pre">date_hierarchy</span></tt>.</p> </div> <div class="section" id="s-deleting-a-model-doesn-t-delete-associated-files"> <span id="deleting-a-model-doesn-t-delete-associated-files"></span><h3>Deleting a model doesn’t delete associated files<a class="headerlink" href="#deleting-a-model-doesn-t-delete-associated-files" title="Permalink to this headline">¶</a></h3> <p>In earlier Django versions, when a model instance containing a <a class="reference internal" href="../ref/models/fields.html#django.db.models.FileField" title="django.db.models.FileField"><tt class="xref py py-class docutils literal"><span class="pre">FileField</span></tt></a> was deleted, <a class="reference internal" href="../ref/models/fields.html#django.db.models.FileField" title="django.db.models.FileField"><tt class="xref py py-class docutils literal"><span class="pre">FileField</span></tt></a> took it upon itself to also delete the file from the backend storage. This opened the door to several data-loss scenarios, including rolled-back transactions and fields on different models referencing the same file. In Django 1.3, when a model is deleted the <a class="reference internal" href="../ref/models/fields.html#django.db.models.FileField" title="django.db.models.FileField"><tt class="xref py py-class docutils literal"><span class="pre">FileField</span></tt></a>‘s <tt class="docutils literal"><span class="pre">delete()</span></tt> method won’t be called. If you need cleanup of orphaned files, you’ll need to handle it yourself (for instance, with a custom management command that can be run manually or scheduled to run periodically via e.g. cron).</p> </div> <div class="section" id="s-passwordinput-default-rendering-behavior"> <span id="passwordinput-default-rendering-behavior"></span><h3>PasswordInput default rendering behavior<a class="headerlink" href="#passwordinput-default-rendering-behavior" title="Permalink to this headline">¶</a></h3> <p>The <a class="reference internal" href="../ref/forms/widgets.html#django.forms.PasswordInput" title="django.forms.PasswordInput"><tt class="xref py py-class docutils literal"><span class="pre">PasswordInput</span></tt></a> form widget, intended for use with form fields which represent passwords, accepts a boolean keyword argument <tt class="docutils literal"><span class="pre">render_value</span></tt> indicating whether to send its data back to the browser when displaying a submitted form with errors. Prior to Django 1.3, this argument defaulted to <tt class="docutils literal"><span class="pre">True</span></tt>, meaning that the submitted password would be sent back to the browser as part of the form. Developers who wished to add a bit of additional security by excluding that value from the redisplayed form could instantiate a <a class="reference internal" href="../ref/forms/widgets.html#django.forms.PasswordInput" title="django.forms.PasswordInput"><tt class="xref py py-class docutils literal"><span class="pre">PasswordInput</span></tt></a> passing <tt class="docutils literal"><span class="pre">render_value=False</span></tt> .</p> <p>Due to the sensitive nature of passwords, however, Django 1.3 takes this step automatically; the default value of <tt class="docutils literal"><span class="pre">render_value</span></tt> is now <tt class="docutils literal"><span class="pre">False</span></tt>, and developers who want the password value returned to the browser on a submission with errors (the previous behavior) must now explicitly indicate this. For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">LoginForm</span><span class="p">(</span><span class="n">forms</span><span class="o">.</span><span class="n">Form</span><span class="p">):</span> <span class="n">username</span> <span class="o">=</span> <span class="n">forms</span><span class="o">.</span><span class="n">CharField</span><span class="p">(</span><span class="n">max_length</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span> <span class="n">password</span> <span class="o">=</span> <span class="n">forms</span><span class="o">.</span><span class="n">CharField</span><span class="p">(</span><span class="n">widget</span><span class="o">=</span><span class="n">forms</span><span class="o">.</span><span class="n">PasswordInput</span><span class="p">(</span><span class="n">render_value</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span> </pre></div> </div> </div> <div class="section" id="s-clearable-default-widget-for-filefield"> <span id="clearable-default-widget-for-filefield"></span><h3>Clearable default widget for FileField<a class="headerlink" href="#clearable-default-widget-for-filefield" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 now includes a <a class="reference internal" href="../ref/forms/widgets.html#django.forms.ClearableFileInput" title="django.forms.ClearableFileInput"><tt class="xref py py-class docutils literal"><span class="pre">ClearableFileInput</span></tt></a> form widget in addition to <a class="reference internal" href="../ref/forms/widgets.html#django.forms.FileInput" title="django.forms.FileInput"><tt class="xref py py-class docutils literal"><span class="pre">FileInput</span></tt></a>. <tt class="docutils literal"><span class="pre">ClearableFileInput</span></tt> renders with a checkbox to clear the field’s value (if the field has a value and is not required); <tt class="docutils literal"><span class="pre">FileInput</span></tt> provided no means for clearing an existing file from a <tt class="docutils literal"><span class="pre">FileField</span></tt>.</p> <p><tt class="docutils literal"><span class="pre">ClearableFileInput</span></tt> is now the default widget for a <tt class="docutils literal"><span class="pre">FileField</span></tt>, so existing forms including <tt class="docutils literal"><span class="pre">FileField</span></tt> without assigning a custom widget will need to account for the possible extra checkbox in the rendered form output.</p> <p>To return to the previous rendering (without the ability to clear the <tt class="docutils literal"><span class="pre">FileField</span></tt>), use the <tt class="docutils literal"><span class="pre">FileInput</span></tt> widget in place of <tt class="docutils literal"><span class="pre">ClearableFileInput</span></tt>. For instance, in a <tt class="docutils literal"><span class="pre">ModelForm</span></tt> for a hypothetical <tt class="docutils literal"><span class="pre">Document</span></tt> model with a <tt class="docutils literal"><span class="pre">FileField</span></tt> named <tt class="docutils literal"><span class="pre">document</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">django</span> <span class="kn">import</span> <span class="n">forms</span> <span class="kn">from</span> <span class="nn">myapp.models</span> <span class="kn">import</span> <span class="n">Document</span> <span class="k">class</span> <span class="nc">DocumentForm</span><span class="p">(</span><span class="n">forms</span><span class="o">.</span><span class="n">ModelForm</span><span class="p">):</span> <span class="k">class</span> <span class="nc">Meta</span><span class="p">:</span> <span class="n">model</span> <span class="o">=</span> <span class="n">Document</span> <span class="n">widgets</span> <span class="o">=</span> <span class="p">{</span><span class="s">'document'</span><span class="p">:</span> <span class="n">forms</span><span class="o">.</span><span class="n">FileInput</span><span class="p">}</span> </pre></div> </div> </div> <div class="section" id="s-new-index-on-database-session-table"> <span id="new-index-on-database-session-table"></span><h3>New index on database session table<a class="headerlink" href="#new-index-on-database-session-table" title="Permalink to this headline">¶</a></h3> <p>Prior to Django 1.3, the database table used by the database backend for the <a class="reference internal" href="../topics/http/sessions.html"><em>sessions</em></a> app had no index on the <tt class="docutils literal"><span class="pre">expire_date</span></tt> column. As a result, date-based queries on the session table – such as the query that is needed to purge old sessions – would be very slow if there were lots of sessions.</p> <p>If you have an existing project that is using the database session backend, you don’t have to do anything to accommodate this change. However, you may get a significant performance boost if you manually add the new index to the session table. The SQL that will add the index can be found by running the <a class="reference internal" href="../ref/django-admin.html#django-admin-sqlindexes"><tt class="xref std std-djadmin docutils literal"><span class="pre">sqlindexes</span></tt></a> admin command:</p> <div class="highlight-python"><pre>python manage.py sqlindexes sessions</pre> </div> </div> <div class="section" id="s-no-more-naughty-words"> <span id="no-more-naughty-words"></span><h3>No more naughty words<a class="headerlink" href="#no-more-naughty-words" title="Permalink to this headline">¶</a></h3> <p>Django has historically provided (and enforced) a list of profanities. The <a class="reference internal" href="../ref/contrib/comments/index.html"><em>comments app</em></a> has enforced this list of profanities, preventing people from submitting comments that contained one of those profanities.</p> <p>Unfortunately, the technique used to implement this profanities list was woefully naive, and prone to the <a class="reference external" href="http://en.wikipedia.org/wiki/Scunthorpe_problem">Scunthorpe problem</a>. Improving the built-in filter to fix this problem would require significant effort, and since natural language processing isn’t the normal domain of a web framework, we have “fixed” the problem by making the list of prohibited words an empty list.</p> <p>If you want to restore the old behavior, simply put a <a class="reference internal" href="../ref/settings.html#std:setting-PROFANITIES_LIST"><tt class="xref std std-setting docutils literal"><span class="pre">PROFANITIES_LIST</span></tt></a> setting in your settings file that includes the words that you want to prohibit (see the <a class="reference external" href="https://code.djangoproject.com/changeset/13996">commit that implemented this change</a> if you want to see the list of words that was historically prohibited). However, if avoiding profanities is important to you, you would be well advised to seek out a better, less naive approach to the problem.</p> </div> <div class="section" id="s-localflavor-changes"> <span id="localflavor-changes"></span><h3>Localflavor changes<a class="headerlink" href="#localflavor-changes" title="Permalink to this headline">¶</a></h3> <p>Django 1.3 introduces the following backwards-incompatible changes to local flavors:</p> <ul class="simple"> <li>Canada (ca) – The province “Newfoundland and Labrador” has had its province code updated to “NL”, rather than the older “NF”. In addition, the Yukon Territory has had its province code corrected to “YT”, instead of “YK”.</li> <li>Indonesia (id) – The province “Nanggroe Aceh Darussalam (NAD)” has been removed from the province list in favor of the new official designation “Aceh (ACE)”.</li> <li>United States of America (us) – The list of “states” used by <tt class="docutils literal"><span class="pre">USStateField</span></tt> has expanded to include Armed Forces postal codes. This is backwards-incompatible if you were relying on <tt class="docutils literal"><span class="pre">USStateField</span></tt> not including them.</li> </ul> </div> <div class="section" id="s-formset-updates"> <span id="formset-updates"></span><h3>FormSet updates<a class="headerlink" href="#formset-updates" title="Permalink to this headline">¶</a></h3> <p>In Django 1.3 <tt class="docutils literal"><span class="pre">FormSet</span></tt> creation behavior is modified slightly. Historically the class didn’t make a distinction between not being passed data and being passed empty dictionary. This was inconsistent with behavior in other parts of the framework. Starting with 1.3 if you pass in empty dictionary the <tt class="docutils literal"><span class="pre">FormSet</span></tt> will raise a <tt class="docutils literal"><span class="pre">ValidationError</span></tt>.</p> <p>For example with a <tt class="docutils literal"><span class="pre">FormSet</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">class</span> <span class="nc">ArticleForm</span><span class="p">(</span><span class="n">Form</span><span class="p">):</span> <span class="gp">... </span> <span class="n">title</span> <span class="o">=</span> <span class="n">CharField</span><span class="p">()</span> <span class="gp">... </span> <span class="n">pub_date</span> <span class="o">=</span> <span class="n">DateField</span><span class="p">()</span> <span class="gp">>>> </span><span class="n">ArticleFormSet</span> <span class="o">=</span> <span class="n">formset_factory</span><span class="p">(</span><span class="n">ArticleForm</span><span class="p">)</span> </pre></div> </div> <p>the following code will raise a <tt class="docutils literal"><span class="pre">ValidationError</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">ArticleFormSet</span><span class="p">({})</span> <span class="gt">Traceback (most recent call last):</span> <span class="c">...</span> <span class="gr">ValidationError</span>: <span class="n">[u'ManagementForm data is missing or has been tampered with']</span> </pre></div> </div> <p>if you need to instantiate an empty <tt class="docutils literal"><span class="pre">FormSet</span></tt>, don’t pass in the data or use <tt class="docutils literal"><span class="pre">None</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">formset</span> <span class="o">=</span> <span class="n">ArticleFormSet</span><span class="p">()</span> <span class="gp">>>> </span><span class="n">formset</span> <span class="o">=</span> <span class="n">ArticleFormSet</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span> </pre></div> </div> </div> <div class="section" id="s-callables-in-templates"> <span id="callables-in-templates"></span><h3>Callables in templates<a class="headerlink" href="#callables-in-templates" title="Permalink to this headline">¶</a></h3> <p>Previously, a callable in a template would only be called automatically as part of the variable resolution process if it was retrieved via attribute lookup. This was an inconsistency that could result in confusing and unhelpful behavior:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">Template</span><span class="p">(</span><span class="s">"{{ user.get_full_name }}"</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">Context</span><span class="p">({</span><span class="s">'user'</span><span class="p">:</span> <span class="n">user</span><span class="p">}))</span> <span class="go">u'Joe Bloggs'</span> <span class="gp">>>> </span><span class="n">Template</span><span class="p">(</span><span class="s">"{{ full_name }}"</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">Context</span><span class="p">({</span><span class="s">'full_name'</span><span class="p">:</span> <span class="n">user</span><span class="o">.</span><span class="n">get_full_name</span><span class="p">}))</span> <span class="go">u'&lt;bound method User.get_full_name of &lt;...</span> </pre></div> </div> <p>This has been resolved in Django 1.3 - the result in both cases will be <tt class="docutils literal"><span class="pre">u'Joe</span> <span class="pre">Bloggs'</span></tt>. Although the previous behavior was not useful for a template language designed for web designers, and was never deliberately supported, it is possible that some templates may be broken by this change.</p> </div> <div class="section" id="s-use-of-custom-sql-to-load-initial-data-in-tests"> <span id="use-of-custom-sql-to-load-initial-data-in-tests"></span><h3>Use of custom SQL to load initial data in tests<a class="headerlink" href="#use-of-custom-sql-to-load-initial-data-in-tests" title="Permalink to this headline">¶</a></h3> <p>Django provides a custom SQL hooks as a way to inject hand-crafted SQL into the database synchronization process. One of the possible uses for this custom SQL is to insert data into your database. If your custom SQL contains <tt class="docutils literal"><span class="pre">INSERT</span></tt> statements, those insertions will be performed every time your database is synchronized. This includes the synchronization of any test databases that are created when you run a test suite.</p> <p>However, in the process of testing the Django 1.3, it was discovered that this feature has never completely worked as advertised. When using database backends that don’t support transactions, or when using a TransactionTestCase, data that has been inserted using custom SQL will not be visible during the testing process.</p> <p>Unfortunately, there was no way to rectify this problem without introducing a backwards incompatibility. Rather than leave SQL-inserted initial data in an uncertain state, Django now enforces the policy that data inserted by custom SQL will <em>not</em> be visible during testing.</p> <p>This change only affects the testing process. You can still use custom SQL to load data into your production database as part of the syncdb process. If you require data to exist during test conditions, you should either insert it using <a class="reference internal" href="../topics/testing/overview.html#topics-testing-fixtures"><em>test fixtures</em></a>, or using the <tt class="docutils literal"><span class="pre">setUp()</span></tt> method of your test case.</p> </div> <div class="section" id="s-changed-priority-of-translation-loading"> <span id="changed-priority-of-translation-loading"></span><h3>Changed priority of translation loading<a class="headerlink" href="#changed-priority-of-translation-loading" title="Permalink to this headline">¶</a></h3> <p>Work has been done to simplify, rationalize and properly document the algorithm used by Django at runtime to build translations from the different translations found on disk, namely:</p> <p>For translatable literals found in Python code and templates (<tt class="docutils literal"><span class="pre">'django'</span></tt> gettext domain):</p> <ul class="simple"> <li>Priorities of translations included with applications listed in the <a class="reference internal" href="../ref/settings.html#std:setting-INSTALLED_APPS"><tt class="xref std std-setting docutils literal"><span class="pre">INSTALLED_APPS</span></tt></a> setting were changed. To provide a behavior consistent with other parts of Django that also use such setting (templates, etc.) now, when building the translation that will be made available, the apps listed first have higher precedence than the ones listed later.</li> <li>Now it is possible to override the translations shipped with applications by using the <a class="reference internal" href="../ref/settings.html#std:setting-LOCALE_PATHS"><tt class="xref std std-setting docutils literal"><span class="pre">LOCALE_PATHS</span></tt></a> setting whose translations have now higher precedence than the translations of <a class="reference internal" href="../ref/settings.html#std:setting-INSTALLED_APPS"><tt class="xref std std-setting docutils literal"><span class="pre">INSTALLED_APPS</span></tt></a> applications. The relative priority among the values listed in this setting has also been modified so the paths listed first have higher precedence than the ones listed later.</li> <li>The <tt class="docutils literal"><span class="pre">locale</span></tt> subdirectory of the directory containing the settings, that usually coincides with and is known as the <em>project directory</em> is being deprecated in this release as a source of translations. (the precedence of these translations is intermediate between applications and <a class="reference internal" href="../ref/settings.html#std:setting-LOCALE_PATHS"><tt class="xref std std-setting docutils literal"><span class="pre">LOCALE_PATHS</span></tt></a> translations). See the <a class="reference internal" href="#loading-of-project-level-translations">corresponding deprecated features section</a> of this document.</li> </ul> <p>For translatable literals found in Javascript code (<tt class="docutils literal"><span class="pre">'djangojs'</span></tt> gettext domain):</p> <ul class="simple"> <li>Similarly to the <tt class="docutils literal"><span class="pre">'django'</span></tt> domain translations: Overriding of translations shipped with applications by using the <a class="reference internal" href="../ref/settings.html#std:setting-LOCALE_PATHS"><tt class="xref std std-setting docutils literal"><span class="pre">LOCALE_PATHS</span></tt></a> setting is now possible for this domain too. These translations have higher precedence than the translations of Python packages passed to the <a class="reference internal" href="../topics/i18n/translation.html#javascript-catalog-view"><em>javascript_catalog view</em></a>. Paths listed first have higher precedence than the ones listed later.</li> <li>Translations under the <tt class="docutils literal"><span class="pre">locale</span></tt> subdirectory of the <em>project directory</em> have never been taken in account for JavaScript translations and remain in the same situation considering the deprecation of such location.</li> </ul> </div> <div class="section" id="s-transaction-management"> <span id="transaction-management"></span><h3>Transaction management<a class="headerlink" href="#transaction-management" title="Permalink to this headline">¶</a></h3> <p>When using managed transactions – that is, anything but the default autocommit mode – it is important when a transaction is marked as “dirty”. Dirty transactions are committed by the <a class="reference internal" href="../topics/db/transactions.html#django.db.transaction.commit_on_success" title="django.db.transaction.commit_on_success"><tt class="xref py py-func docutils literal"><span class="pre">commit_on_success()</span></tt></a> decorator or the <a class="reference internal" href="../ref/middleware.html#django.middleware.transaction.TransactionMiddleware" title="django.middleware.transaction.TransactionMiddleware"><tt class="xref py py-class docutils literal"><span class="pre">TransactionMiddleware</span></tt></a>, and <a class="reference internal" href="../topics/db/transactions.html#django.db.transaction.commit_manually" title="django.db.transaction.commit_manually"><tt class="xref py py-func docutils literal"><span class="pre">commit_manually()</span></tt></a> forces them to be closed explicitly; clean transactions “get a pass”, which means they are usually rolled back at the end of a request when the connection is closed.</p> <p>Until Django 1.3, transactions were only marked dirty when Django was aware of a modifying operation performed in them; that is, either some model was saved, some bulk update or delete was performed, or the user explicitly called <tt class="docutils literal"><span class="pre">transaction.set_dirty()</span></tt>. In Django 1.3, a transaction is marked dirty when <em>any</em> database operation is performed.</p> <p>As a result of this change, you no longer need to set a transaction dirty explicitly when you execute raw SQL or use a data-modifying <tt class="docutils literal"><span class="pre">SELECT</span></tt>. However, you <em>do</em> need to explicitly close any read-only transactions that are being managed using <a class="reference internal" href="../topics/db/transactions.html#django.db.transaction.commit_manually" title="django.db.transaction.commit_manually"><tt class="xref py py-func docutils literal"><span class="pre">commit_manually()</span></tt></a>. For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="nd">@transaction.commit_manually</span> <span class="k">def</span> <span class="nf">my_view</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span> <span class="n">obj</span> <span class="o">=</span> <span class="n">get_object_or_404</span><span class="p">(</span><span class="n">MyObject</span><span class="p">,</span> <span class="n">name__iexact</span><span class="o">=</span><span class="n">name</span><span class="p">)</span> <span class="k">return</span> <span class="n">render_to_response</span><span class="p">(</span><span class="s">'template'</span><span class="p">,</span> <span class="p">{</span><span class="s">'object'</span><span class="p">:</span><span class="n">obj</span><span class="p">})</span> </pre></div> </div> <p>Prior to Django 1.3, this would work without error. However, under Django 1.3, this will raise a <a class="reference internal" href="../ref/exceptions.html#django.db.transaction.TransactionManagementError" title="django.db.transaction.TransactionManagementError"><tt class="xref py py-class docutils literal"><span class="pre">TransactionManagementError</span></tt></a> because the read operation that retrieves the <tt class="docutils literal"><span class="pre">MyObject</span></tt> instance leaves the transaction in a dirty state.</p> </div> <div class="section" id="s-no-password-reset-for-inactive-users"> <span id="no-password-reset-for-inactive-users"></span><h3>No password reset for inactive users<a class="headerlink" href="#no-password-reset-for-inactive-users" title="Permalink to this headline">¶</a></h3> <p>Prior to Django 1.3, inactive users were able to request a password reset email and reset their password. In Django 1.3 inactive users will receive the same message as a nonexistent account.</p> </div> <div class="section" id="s-password-reset-view-now-accepts-from-email"> <span id="password-reset-view-now-accepts-from-email"></span><h3>Password reset view now accepts <tt class="docutils literal"><span class="pre">from_email</span></tt><a class="headerlink" href="#password-reset-view-now-accepts-from-email" title="Permalink to this headline">¶</a></h3> <p>The <a class="reference internal" href="../topics/auth/default.html#django.contrib.auth.views.password_reset" title="django.contrib.auth.views.password_reset"><tt class="xref py py-func docutils literal"><span class="pre">django.contrib.auth.views.password_reset()</span></tt></a> view now accepts a <tt class="docutils literal"><span class="pre">from_email</span></tt> parameter, which is passed to the <tt class="docutils literal"><span class="pre">password_reset_form</span></tt>‘s <tt class="docutils literal"><span class="pre">save()</span></tt> method as a keyword argument. If you are using this view with a custom password reset form, then you will need to ensure your form’s <tt class="docutils literal"><span class="pre">save()</span></tt> method accepts this keyword argument.</p> </div> </div> <div class="section" id="s-features-deprecated-in-1-3"> <span id="s-deprecated-features-1-3"></span><span id="features-deprecated-in-1-3"></span><span id="deprecated-features-1-3"></span><h2>Features deprecated in 1.3<a class="headerlink" href="#features-deprecated-in-1-3" title="Permalink to this headline">¶</a></h2> <p>Django 1.3 deprecates some features from earlier releases. These features are still supported, but will be gradually phased out over the next few release cycles.</p> <p>Code taking advantage of any of the features below will raise a <tt class="docutils literal"><span class="pre">PendingDeprecationWarning</span></tt> in Django 1.3. This warning will be silent by default, but may be turned on using Python’s <a class="reference external" href="http://docs.python.org/2.7/library/warnings.html#warnings" title="(in Python v2.7)"><tt class="xref py py-mod docutils literal"><span class="pre">warnings</span></tt></a> module, or by running Python with a <tt class="docutils literal"><span class="pre">-Wd</span></tt> or <tt class="docutils literal"><span class="pre">-Wall</span></tt> flag.</p> <p>In Django 1.4, these warnings will become a <tt class="docutils literal"><span class="pre">DeprecationWarning</span></tt>, which is <em>not</em> silent. In Django 1.5 support for these features will be removed entirely.</p> <div class="admonition-see-also admonition seealso"> <p class="first admonition-title">See also</p> <p class="last">For more details, see the documentation <a class="reference internal" href="../internals/release-process.html"><em>Django’s release process</em></a> and our <a class="reference internal" href="../internals/deprecation.html"><em>deprecation timeline</em></a>.</p> </div> <div class="section" id="s-mod-python-support"> <span id="mod-python-support"></span><h3><tt class="docutils literal"><span class="pre">mod_python</span></tt> support<a class="headerlink" href="#mod-python-support" title="Permalink to this headline">¶</a></h3> <p>The <tt class="docutils literal"><span class="pre">mod_python</span></tt> library has not had a release since 2007 or a commit since 2008. The Apache Foundation board voted to remove <tt class="docutils literal"><span class="pre">mod_python</span></tt> from the set of active projects in its version control repositories, and its lead developer has shifted all of his efforts toward the lighter, slimmer, more stable, and more flexible <tt class="docutils literal"><span class="pre">mod_wsgi</span></tt> backend.</p> <p>If you are currently using the <tt class="docutils literal"><span class="pre">mod_python</span></tt> request handler, you should redeploy your Django projects using another request handler. <a class="reference internal" href="../howto/deployment/wsgi/modwsgi.html"><em>mod_wsgi</em></a> is the request handler recommended by the Django project, but <a class="reference internal" href="../howto/deployment/fastcgi.html"><em>FastCGI</em></a> is also supported. Support for <tt class="docutils literal"><span class="pre">mod_python</span></tt> deployment will be removed in Django 1.5.</p> </div> <div class="section" id="s-function-based-generic-views"> <span id="function-based-generic-views"></span><h3>Function-based generic views<a class="headerlink" href="#function-based-generic-views" title="Permalink to this headline">¶</a></h3> <p>As a result of the introduction of class-based generic views, the function-based generic views provided by Django have been deprecated. The following modules and the views they contain have been deprecated:</p> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">django.views.generic.create_update</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.views.generic.date_based</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.views.generic.list_detail</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.views.generic.simple</span></tt></li> </ul> </div> <div class="section" id="s-test-client-response-template-attribute"> <span id="test-client-response-template-attribute"></span><h3>Test client response <tt class="docutils literal"><span class="pre">template</span></tt> attribute<a class="headerlink" href="#test-client-response-template-attribute" title="Permalink to this headline">¶</a></h3> <p>Django’s <a class="reference internal" href="../topics/testing/overview.html#test-client"><em>test client</em></a> returns <a class="reference internal" href="../topics/testing/overview.html#django.test.client.Response" title="django.test.client.Response"><tt class="xref py py-class docutils literal"><span class="pre">Response</span></tt></a> objects annotated with extra testing information. In Django versions prior to 1.3, this included a <tt class="docutils literal"><span class="pre">template</span></tt> attribute containing information about templates rendered in generating the response: either None, a single <a class="reference internal" href="../ref/templates/api.html#django.template.Template" title="django.template.Template"><tt class="xref py py-class docutils literal"><span class="pre">Template</span></tt></a> object, or a list of <a class="reference internal" href="../ref/templates/api.html#django.template.Template" title="django.template.Template"><tt class="xref py py-class docutils literal"><span class="pre">Template</span></tt></a> objects. This inconsistency in return values (sometimes a list, sometimes not) made the attribute difficult to work with.</p> <p>In Django 1.3 the <tt class="docutils literal"><span class="pre">template</span></tt> attribute is deprecated in favor of a new <a class="reference internal" href="../topics/testing/overview.html#django.test.client.Response.templates" title="django.test.client.Response.templates"><tt class="xref py py-attr docutils literal"><span class="pre">templates</span></tt></a> attribute, which is always a list, even if it has only a single element or no elements.</p> </div> <div class="section" id="s-djangotestrunner"> <span id="djangotestrunner"></span><h3><tt class="docutils literal"><span class="pre">DjangoTestRunner</span></tt><a class="headerlink" href="#djangotestrunner" title="Permalink to this headline">¶</a></h3> <p>As a result of the introduction of support for unittest2, the features of <tt class="docutils literal"><span class="pre">django.test.simple.DjangoTestRunner</span></tt> (including fail-fast and Ctrl-C test termination) have been made redundant. In view of this redundancy, <tt class="docutils literal"><span class="pre">DjangoTestRunner</span></tt> has been turned into an empty placeholder class, and will be removed entirely in Django 1.5.</p> </div> <div class="section" id="s-changes-to-url-and-ssi"> <span id="changes-to-url-and-ssi"></span><h3>Changes to <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-url"><tt class="xref std std-ttag docutils literal"><span class="pre">url</span></tt></a> and <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-ssi"><tt class="xref std std-ttag docutils literal"><span class="pre">ssi</span></tt></a><a class="headerlink" href="#changes-to-url-and-ssi" title="Permalink to this headline">¶</a></h3> <p>Most template tags will allow you to pass in either constants or variables as arguments – for example:</p> <div class="highlight-python"><pre>{% extends "base.html" %}</pre> </div> <p>allows you to specify a base template as a constant, but if you have a context variable <tt class="docutils literal"><span class="pre">templ</span></tt> that contains the value <tt class="docutils literal"><span class="pre">base.html</span></tt>:</p> <div class="highlight-python"><pre>{% extends templ %}</pre> </div> <p>is also legal.</p> <p>However, due to an accident of history, the <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-url"><tt class="xref std std-ttag docutils literal"><span class="pre">url</span></tt></a> and <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-ssi"><tt class="xref std std-ttag docutils literal"><span class="pre">ssi</span></tt></a> are different. These tags use the second, quoteless syntax, but interpret the argument as a constant. This means it isn’t possible to use a context variable as the target of a <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-url"><tt class="xref std std-ttag docutils literal"><span class="pre">url</span></tt></a> and <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-ssi"><tt class="xref std std-ttag docutils literal"><span class="pre">ssi</span></tt></a> tag.</p> <p>Django 1.3 marks the start of the process to correct this historical accident. Django 1.3 adds a new template library – <tt class="docutils literal"><span class="pre">future</span></tt> – that provides alternate implementations of the <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-url"><tt class="xref std std-ttag docutils literal"><span class="pre">url</span></tt></a> and <a class="reference internal" href="../ref/templates/builtins.html#std:templatetag-ssi"><tt class="xref std std-ttag docutils literal"><span class="pre">ssi</span></tt></a> template tags. This <tt class="docutils literal"><span class="pre">future</span></tt> library implement behavior that makes the handling of the first argument consistent with the handling of all other variables. So, an existing template that contains:</p> <div class="highlight-python"><pre>{% url sample %}</pre> </div> <p>should be replaced with:</p> <div class="highlight-python"><pre>{% load url from future %} {% url 'sample' %}</pre> </div> <p>The tags implementing the old behavior have been deprecated, and in Django 1.5, the old behavior will be replaced with the new behavior. To ensure compatibility with future versions of Django, existing templates should be modified to use the new <tt class="docutils literal"><span class="pre">future</span></tt> libraries and syntax.</p> </div> <div class="section" id="s-changes-to-the-login-methods-of-the-admin"> <span id="changes-to-the-login-methods-of-the-admin"></span><h3>Changes to the login methods of the admin<a class="headerlink" href="#changes-to-the-login-methods-of-the-admin" title="Permalink to this headline">¶</a></h3> <p>In previous version the admin app defined login methods in multiple locations and ignored the almost identical implementation in the already used auth app. A side effect of this duplication was the missing adoption of the changes made in <a class="reference external" href="https://code.djangoproject.com/changeset/12634">r12634</a> to support a broader set of characters for usernames.</p> <p>This release refactors the admin’s login mechanism to use a subclass of the <a class="reference internal" href="../topics/auth/default.html#django.contrib.auth.forms.AuthenticationForm" title="django.contrib.auth.forms.AuthenticationForm"><tt class="xref py py-class docutils literal"><span class="pre">AuthenticationForm</span></tt></a> instead of a manual form validation. The previously undocumented method <tt class="docutils literal"><span class="pre">'django.contrib.admin.sites.AdminSite.display_login_form'</span></tt> has been removed in favor of a new <a class="reference internal" href="../ref/contrib/admin/index.html#django.contrib.admin.AdminSite.login_form" title="django.contrib.admin.AdminSite.login_form"><tt class="xref py py-attr docutils literal"><span class="pre">login_form</span></tt></a> attribute.</p> </div> <div class="section" id="s-reset-and-sqlreset-management-commands"> <span id="reset-and-sqlreset-management-commands"></span><h3><tt class="docutils literal"><span class="pre">reset</span></tt> and <tt class="docutils literal"><span class="pre">sqlreset</span></tt> management commands<a class="headerlink" href="#reset-and-sqlreset-management-commands" title="Permalink to this headline">¶</a></h3> <p>Those commands have been deprecated. The <tt class="docutils literal"><span class="pre">flush</span></tt> and <tt class="docutils literal"><span class="pre">sqlflush</span></tt> commands can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.</p> </div> <div class="section" id="s-id1"> <span id="id1"></span><h3>GeoDjango<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>The function-based <a class="reference internal" href="../ref/settings.html#std:setting-TEST_RUNNER"><tt class="xref std std-setting docutils literal"><span class="pre">TEST_RUNNER</span></tt></a> previously used to execute the GeoDjango test suite, <tt class="docutils literal"><span class="pre">django.contrib.gis.tests.run_gis_tests</span></tt>, was deprecated for the class-based runner, <a class="reference internal" href="../ref/contrib/gis/testing.html#django.contrib.gis.tests.GeoDjangoTestSuiteRunner" title="django.contrib.gis.tests.GeoDjangoTestSuiteRunner"><tt class="xref py py-class docutils literal"><span class="pre">django.contrib.gis.tests.GeoDjangoTestSuiteRunner</span></tt></a>.</li> <li>Previously, calling <a class="reference internal" href="../ref/contrib/gis/geos.html#django.contrib.gis.geos.GEOSGeometry.transform" title="django.contrib.gis.geos.GEOSGeometry.transform"><tt class="xref py py-meth docutils literal"><span class="pre">transform()</span></tt></a> would silently do nothing when GDAL wasn’t available. Now, a <a class="reference internal" href="../ref/contrib/gis/geos.html#django.contrib.gis.geos.GEOSException" title="django.contrib.gis.geos.GEOSException"><tt class="xref py py-class docutils literal"><span class="pre">GEOSException</span></tt></a> is properly raised to indicate possible faulty application code. A warning is now raised if <a class="reference internal" href="../ref/contrib/gis/geos.html#django.contrib.gis.geos.GEOSGeometry.transform" title="django.contrib.gis.geos.GEOSGeometry.transform"><tt class="xref py py-meth docutils literal"><span class="pre">transform()</span></tt></a> is called when the SRID of the geometry is less than 0 or <tt class="docutils literal"><span class="pre">None</span></tt>.</li> </ul> </div> <div class="section" id="s-czbirthnumberfield-clean"> <span id="czbirthnumberfield-clean"></span><h3><tt class="docutils literal"><span class="pre">CZBirthNumberField.clean</span></tt><a class="headerlink" href="#czbirthnumberfield-clean" title="Permalink to this headline">¶</a></h3> <p>Previously this field’s <tt class="docutils literal"><span class="pre">clean()</span></tt> method accepted a second, gender, argument which allowed stronger validation checks to be made, however since this argument could never actually be passed from the Django form machinery it is now pending deprecation.</p> </div> <div class="section" id="s-compatcookie"> <span id="compatcookie"></span><h3><tt class="docutils literal"><span class="pre">CompatCookie</span></tt><a class="headerlink" href="#compatcookie" title="Permalink to this headline">¶</a></h3> <p>Previously, <tt class="docutils literal"><span class="pre">django.http</span></tt> exposed an undocumented <tt class="docutils literal"><span class="pre">CompatCookie</span></tt> class, which was a bugfix wrapper around the standard library <tt class="docutils literal"><span class="pre">SimpleCookie</span></tt>. As the fixes are moving upstream, this is now deprecated - you should use <tt class="docutils literal"><span class="pre">from</span> <span class="pre">django.http</span> <span class="pre">import</span> <span class="pre">SimpleCookie</span></tt> instead.</p> </div> <div class="section" id="s-loading-of-project-level-translations"> <span id="s-id2"></span><span id="loading-of-project-level-translations"></span><span id="id2"></span><h3>Loading of <em>project-level</em> translations<a class="headerlink" href="#loading-of-project-level-translations" title="Permalink to this headline">¶</a></h3> <p>This release of Django starts the deprecation process for inclusion of translations located under the so-called <em>project path</em> in the translation building process performed at runtime. The <a class="reference internal" href="../ref/settings.html#std:setting-LOCALE_PATHS"><tt class="xref std std-setting docutils literal"><span class="pre">LOCALE_PATHS</span></tt></a> setting can be used for the same task by adding the filesystem path to a <tt class="docutils literal"><span class="pre">locale</span></tt> directory containing project-level translations to the value of that setting.</p> <p>Rationale for this decision:</p> <ul> <li><p class="first">The <em>project path</em> has always been a loosely defined concept (actually, the directory used for locating project-level translations is the directory containing the settings module) and there has been a shift in other parts of the framework to stop using it as a reference for location of assets at runtime.</p> </li> <li><p class="first">Detection of the <tt class="docutils literal"><span class="pre">locale</span></tt> subdirectory tends to fail when the deployment scenario is more complex than the basic one. e.g. it fails when the settings module is a directory (ticket #10765).</p> </li> <li><p class="first">There are potential strange development- and deployment-time problems like the fact that the <tt class="docutils literal"><span class="pre">project_dir/locale/</span></tt> subdir can generate spurious error messages when the project directory is added to the Python path (<tt class="docutils literal"><span class="pre">manage.py</span> <span class="pre">runserver</span></tt> does this) and then it clashes with the equally named standard library module, this is a typical warning message:</p> <div class="highlight-python"><pre>/usr/lib/python2.6/gettext.py:49: ImportWarning: Not importing directory '/path/to/project/locale': missing __init__.py. import locale, copy, os, re, struct, sys</pre> </div> </li> <li><p class="first">This location wasn’t included in the translation building process for JavaScript literals. This deprecation removes such inconsistency.</p> </li> </ul> </div> <div class="section" id="s-permwrapper-moved-to-django-contrib-auth-context-processors"> <span id="permwrapper-moved-to-django-contrib-auth-context-processors"></span><h3><tt class="docutils literal"><span class="pre">PermWrapper</span></tt> moved to <tt class="docutils literal"><span class="pre">django.contrib.auth.context_processors</span></tt><a class="headerlink" href="#permwrapper-moved-to-django-contrib-auth-context-processors" title="Permalink to this headline">¶</a></h3> <p>In Django 1.2, we began the process of changing the location of the <tt class="docutils literal"><span class="pre">auth</span></tt> context processor from <tt class="docutils literal"><span class="pre">django.core.context_processors</span></tt> to <tt class="docutils literal"><span class="pre">django.contrib.auth.context_processors</span></tt>. However, the <tt class="docutils literal"><span class="pre">PermWrapper</span></tt> support class was mistakenly omitted from that migration. In Django 1.3, the <tt class="docutils literal"><span class="pre">PermWrapper</span></tt> class has also been moved to <tt class="docutils literal"><span class="pre">django.contrib.auth.context_processors</span></tt>, along with the <tt class="docutils literal"><span class="pre">PermLookupDict</span></tt> support class. The new classes are functionally identical to their old versions; only the module location has changed.</p> </div> <div class="section" id="s-removal-of-xmlfield"> <span id="removal-of-xmlfield"></span><h3>Removal of <tt class="docutils literal"><span class="pre">XMLField</span></tt><a class="headerlink" href="#removal-of-xmlfield" title="Permalink to this headline">¶</a></h3> <p>When Django was first released, Django included an <tt class="docutils literal"><span class="pre">XMLField</span></tt> that performed automatic XML validation for any field input. However, this validation function hasn’t been performed since the introduction of <tt class="docutils literal"><span class="pre">newforms</span></tt>, prior to the 1.0 release. As a result, <tt class="docutils literal"><span class="pre">XMLField</span></tt> as currently implemented is functionally indistinguishable from a simple <a class="reference internal" href="../ref/models/fields.html#django.db.models.TextField" title="django.db.models.TextField"><tt class="xref py py-class docutils literal"><span class="pre">TextField</span></tt></a>.</p> <p>For this reason, Django 1.3 has fast-tracked the deprecation of <tt class="docutils literal"><span class="pre">XMLField</span></tt> – instead of a two-release deprecation, <tt class="docutils literal"><span class="pre">XMLField</span></tt> will be removed entirely in Django 1.4.</p> <p>It’s easy to update your code to accommodate this change – just replace all uses of <tt class="docutils literal"><span class="pre">XMLField</span></tt> with <tt class="docutils literal"><span class="pre">TextField</span></tt>, and remove the <tt class="docutils literal"><span class="pre">schema_path</span></tt> keyword argument (if it is specified).</p> </div> </div> </div> </div> </div> </div> <div class="yui-b" id="sidebar"> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Django 1.3 release notes</a><ul> <li><a class="reference internal" href="#overview">Overview</a></li> <li><a class="reference internal" href="#python-compatibility">Python compatibility</a></li> <li><a class="reference internal" href="#what-s-new-in-django-1-3">What’s new in Django 1.3</a><ul> <li><a class="reference internal" href="#class-based-views">Class-based views</a></li> <li><a class="reference internal" href="#logging">Logging</a></li> <li><a class="reference internal" href="#extended-static-files-handling">Extended static files handling</a></li> <li><a class="reference internal" href="#unittest2-support">unittest2 support</a></li> <li><a class="reference internal" href="#transaction-context-managers">Transaction context managers</a></li> <li><a class="reference internal" href="#configurable-delete-cascade">Configurable delete-cascade</a></li> <li><a class="reference internal" href="#contextual-markers-and-comments-for-translatable-strings">Contextual markers and comments for translatable strings</a></li> <li><a class="reference internal" href="#improvements-to-built-in-template-tags">Improvements to built-in template tags</a></li> <li><a class="reference internal" href="#templateresponse">TemplateResponse</a></li> <li><a class="reference internal" href="#caching-changes">Caching changes</a></li> <li><a class="reference internal" href="#permissions-for-inactive-users">Permissions for inactive users</a></li> <li><a class="reference internal" href="#geodjango">GeoDjango</a></li> <li><a class="reference internal" href="#media-url-and-static-url-must-end-in-a-slash"><tt class="docutils literal"><span class="pre">MEDIA_URL</span></tt> and <tt class="docutils literal"><span class="pre">STATIC_URL</span></tt> must end in a slash</a></li> <li><a class="reference internal" href="#everything-else">Everything else</a></li> </ul> </li> <li><a class="reference internal" href="#backwards-incompatible-changes-in-1-3">Backwards-incompatible changes in 1.3</a><ul> <li><a class="reference internal" href="#csrf-validation-now-applies-to-ajax-requests">CSRF validation now applies to AJAX requests</a></li> <li><a class="reference internal" href="#restricted-filters-in-admin-interface">Restricted filters in admin interface</a></li> <li><a class="reference internal" href="#deleting-a-model-doesn-t-delete-associated-files">Deleting a model doesn’t delete associated files</a></li> <li><a class="reference internal" href="#passwordinput-default-rendering-behavior">PasswordInput default rendering behavior</a></li> <li><a class="reference internal" href="#clearable-default-widget-for-filefield">Clearable default widget for FileField</a></li> <li><a class="reference internal" href="#new-index-on-database-session-table">New index on database session table</a></li> <li><a class="reference internal" href="#no-more-naughty-words">No more naughty words</a></li> <li><a class="reference internal" href="#localflavor-changes">Localflavor changes</a></li> <li><a class="reference internal" href="#formset-updates">FormSet updates</a></li> <li><a class="reference internal" href="#callables-in-templates">Callables in templates</a></li> <li><a class="reference internal" href="#use-of-custom-sql-to-load-initial-data-in-tests">Use of custom SQL to load initial data in tests</a></li> <li><a class="reference internal" href="#changed-priority-of-translation-loading">Changed priority of translation loading</a></li> <li><a class="reference internal" href="#transaction-management">Transaction management</a></li> <li><a class="reference internal" href="#no-password-reset-for-inactive-users">No password reset for inactive users</a></li> <li><a class="reference internal" href="#password-reset-view-now-accepts-from-email">Password reset view now accepts <tt class="docutils literal"><span class="pre">from_email</span></tt></a></li> </ul> </li> <li><a class="reference internal" href="#features-deprecated-in-1-3">Features deprecated in 1.3</a><ul> <li><a class="reference internal" href="#mod-python-support"><tt class="docutils literal"><span class="pre">mod_python</span></tt> support</a></li> <li><a class="reference internal" href="#function-based-generic-views">Function-based generic views</a></li> <li><a class="reference internal" href="#test-client-response-template-attribute">Test client response <tt class="docutils literal"><span class="pre">template</span></tt> attribute</a></li> <li><a class="reference internal" href="#djangotestrunner"><tt class="docutils literal"><span class="pre">DjangoTestRunner</span></tt></a></li> <li><a class="reference internal" href="#changes-to-url-and-ssi">Changes to <tt class="docutils literal"><span class="pre">url</span></tt> and <tt class="docutils literal"><span class="pre">ssi</span></tt></a></li> <li><a class="reference internal" href="#changes-to-the-login-methods-of-the-admin">Changes to the login methods of the admin</a></li> <li><a class="reference internal" href="#reset-and-sqlreset-management-commands"><tt class="docutils literal"><span class="pre">reset</span></tt> and <tt class="docutils literal"><span class="pre">sqlreset</span></tt> management commands</a></li> <li><a class="reference internal" href="#id1">GeoDjango</a></li> <li><a class="reference internal" href="#czbirthnumberfield-clean"><tt class="docutils literal"><span class="pre">CZBirthNumberField.clean</span></tt></a></li> <li><a class="reference internal" href="#compatcookie"><tt class="docutils literal"><span class="pre">CompatCookie</span></tt></a></li> <li><a class="reference internal" href="#loading-of-project-level-translations">Loading of <em>project-level</em> translations</a></li> <li><a class="reference internal" href="#permwrapper-moved-to-django-contrib-auth-context-processors"><tt class="docutils literal"><span class="pre">PermWrapper</span></tt> moved to <tt class="docutils literal"><span class="pre">django.contrib.auth.context_processors</span></tt></a></li> <li><a class="reference internal" href="#removal-of-xmlfield">Removal of <tt class="docutils literal"><span class="pre">XMLField</span></tt></a></li> </ul> </li> </ul> </li> </ul> <h3>Browse</h3> <ul> <li>Prev: <a href="1.3.1.html">Django 1.3.1 release notes</a></li> <li>Next: <a href="1.2.7.html">Django 1.2.7 release notes</a></li> </ul> <h3>You are here:</h3> <ul> <li> <a href="../index.html">Django 1.5.8 documentation</a> <ul><li><a href="index.html">Release notes</a> <ul><li>Django 1.3 release notes</li></ul> </li></ul> </li> </ul> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/releases/1.3.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <h3>Last update:</h3> <p class="topless">May 15, 2014</p> </div> </div> <div id="ft"> <div class="nav"> « <a href="1.3.1.html" title="Django 1.3.1 release notes">previous</a> | <a href="index.html" title="Release notes" accesskey="U">up</a> | <a href="1.2.7.html" title="Django 1.2.7 release notes">next</a> »</div> </div> </div> <div class="clearer"></div> </div> </body> </html>