{"title":"Django 1.1 release notes","version":"dev","locale":"en","docname":"releases/1.1","url":"/en/dev/releases/1.1/","canonical":"https://djangodocs.dev/en/dev/releases/1.1/","summary":"July 29, 2009. Welcome to Django 1.1! Django 1.1 includes a number of nifty new features, lots of bug fixes, and an easy upgrade path from Django 1.0.","html":"<h1>Django 1.1 release notes<a class=\"heading-anchor\" href=\"#django-1-1-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>July 29, 2009</p>\n<p>Welcome to Django 1.1!</p>\n<p>Django 1.1 includes a number of nifty <a class=\"reference internal\" href=\"#whats-new-1-1\"><span class=\"std std-ref\">new features</span></a>, lots\nof bug fixes, and an easy upgrade path from Django 1.0.</p>\n<section id=\"backwards-incompatible-changes-in-1-1\">\n<span id=\"backwards-incompatible-changes-1-1\"></span><h2>Backwards-incompatible changes in 1.1<a class=\"heading-anchor\" href=\"#backwards-incompatible-changes-in-1-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django has a policy of <a class=\"reference internal\" href=\"/en/dev/misc/api-stability/\"><span class=\"doc\">API stability</span></a>. This means\nthat, in general, code you develop against Django 1.0 should continue to work\nagainst 1.1 unchanged. However, we do sometimes make backwards-incompatible\nchanges if they’re necessary to resolve bugs, and there are a handful of such\n(minor) changes between Django 1.0 and Django 1.1.</p>\n<p>Before upgrading to Django 1.1 you should double-check that the following\nchanges don’t impact you, and upgrade your code if they do.</p>\n<section id=\"changes-to-constraint-names\">\n<h3>Changes to constraint names<a class=\"heading-anchor\" href=\"#changes-to-constraint-names\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 1.1 modifies the method used to generate database constraint names so\nthat names are consistent regardless of machine word size. This change is\nbackwards incompatible for some users.</p>\n<p>If you are using a 32-bit platform, you’re off the hook; you’ll observe no\ndifferences as a result of this change.</p>\n<p>However, <strong>users on 64-bit platforms may experience some problems</strong> using the\n<code class=\"docutils literal notranslate\">reset</code> management command. Prior to this change, 64-bit platforms\nwould generate a 64-bit, 16 character digest in the constraint name; for\nexample:</p>\n<div class=\"code-block\" data-language=\"sql\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">SQL</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"SQL code\"><code><span class=\"k\">ALTER</span> <span class=\"k\">TABLE</span> myapp_sometable <span class=\"k\">ADD</span> <span class=\"k\">CONSTRAINT</span> object_id_refs_id_5e8f10c132091d1e <span class=\"k\">FOREIGN</span> <span class=\"k\">KEY</span> <span class=\"p\">...</span>\n</code></pre></div>\n<p>Following this change, all platforms, regardless of word size, will generate a\n32-bit, 8 character digest in the constraint name; for example:</p>\n<div class=\"code-block\" data-language=\"sql\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">SQL</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"SQL code\"><code><span class=\"k\">ALTER</span> <span class=\"k\">TABLE</span> myapp_sometable <span class=\"k\">ADD</span> <span class=\"k\">CONSTRAINT</span> object_id_refs_id_32091d1e <span class=\"k\">FOREIGN</span> <span class=\"k\">KEY</span> <span class=\"p\">...</span>\n</code></pre></div>\n<p>As a result of this change, you will not be able to use the <code class=\"docutils literal notranslate\">reset</code>\nmanagement command on any table made by a 64-bit machine. This is because the\nnew generated name will not match the historically generated name; as a\nresult, the SQL constructed by the reset command will be invalid.</p>\n<p>If you need to reset an application that was created with 64-bit constraints,\nyou will need to manually drop the old constraint prior to invoking\n<code class=\"docutils literal notranslate\">reset</code>.</p>\n</section>\n<section id=\"test-cases-are-now-run-in-a-transaction\">\n<h3>Test cases are now run in a transaction<a class=\"heading-anchor\" href=\"#test-cases-are-now-run-in-a-transaction\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 1.1 runs tests inside a transaction, allowing better test performance\n(see <a class=\"reference internal\" href=\"#test-performance-improvements\">test performance improvements</a> for details).</p>\n<p>This change is slightly backwards incompatible if existing tests need to test\ntransactional behavior, if they rely on invalid assumptions about the test\nenvironment, or if they require a specific test case ordering.</p>\n<p>For these cases, <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.TransactionTestCase\" title=\"django.test.TransactionTestCase\"><code class=\"xref py py-class docutils literal notranslate\">TransactionTestCase</code></a> can be used instead.\nThis is a just a quick fix to get around test case errors revealed by the new\nrollback approach; in the long-term tests should be rewritten to correct the\ntest case.</p>\n</section>\n<section id=\"removed-setremoteaddrfromforwardedfor-middleware\">\n<span id=\"id1\"></span><h3>Removed <code class=\"docutils literal notranslate\">SetRemoteAddrFromForwardedFor</code> middleware<a class=\"heading-anchor\" href=\"#removed-setremoteaddrfromforwardedfor-middleware\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>For convenience, Django 1.0 included an optional middleware class –\n<code class=\"docutils literal notranslate\">django.middleware.http.SetRemoteAddrFromForwardedFor</code> – which updated the\nvalue of <code class=\"docutils literal notranslate\">REMOTE_ADDR</code> based on the HTTP <code class=\"docutils literal notranslate\">X-Forwarded-For</code> header commonly\nset by some proxy configurations.</p>\n<p>It has been demonstrated that this mechanism cannot be made reliable enough for\ngeneral-purpose use, and that (despite documentation to the contrary) its\ninclusion in Django may lead application developers to assume that the value of\n<code class=\"docutils literal notranslate\">REMOTE_ADDR</code> is “safe” or in some way reliable as a source of\nauthentication.</p>\n<p>While not directly a security issue, we’ve decided to remove this middleware\nwith the Django 1.1 release. It has been replaced with a class that does\nnothing other than raise a <code class=\"docutils literal notranslate\">DeprecationWarning</code>.</p>\n<p>If you’ve been relying on this middleware, the easiest upgrade path is:</p>\n<ul class=\"simple\">\n<li><p>Examine <a class=\"reference external\" href=\"https://github.com/django/django/blob/91f18400cc0fb37659e2dbaab5484ff2081f1f30/django/middleware/http.py#L33\">the code as it existed before it was removed</a>.</p></li>\n<li><p>Verify that it works correctly with your upstream proxy, modifying\nit to support your particular proxy (if necessary).</p></li>\n<li><p>Introduce your modified version of <code class=\"docutils literal notranslate\">SetRemoteAddrFromForwardedFor</code> as a\npiece of middleware in your own project.</p></li>\n</ul>\n</section>\n<section id=\"names-of-uploaded-files-are-available-later\">\n<h3>Names of uploaded files are available later<a class=\"heading-anchor\" href=\"#names-of-uploaded-files-are-available-later\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>In Django 1.0, files uploaded and stored in a model’s <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.FileField\" title=\"django.db.models.FileField\"><code class=\"xref py py-class docutils literal notranslate\">FileField</code></a> were\nsaved to disk before the model was saved to the database. This meant that the\nactual file name assigned to the file was available before saving. For example,\nit was available in a model’s pre-save signal handler.</p>\n<p>In Django 1.1 the file is saved as part of saving the model in the database, so\nthe actual file name used on disk cannot be relied on until <em>after</em> the model\nhas been saved.</p>\n</section>\n<section id=\"changes-to-how-model-formsets-are-saved\">\n<h3>Changes to how model formsets are saved<a class=\"heading-anchor\" href=\"#changes-to-how-model-formsets-are-saved\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>In Django 1.1, <a class=\"reference internal\" href=\"/en/dev/topics/forms/modelforms/#django.forms.models.BaseModelFormSet\" title=\"django.forms.models.BaseModelFormSet\"><code class=\"xref py py-class docutils literal notranslate\">BaseModelFormSet</code></a> now calls\n<code class=\"docutils literal notranslate\">ModelForm.save()</code>.</p>\n<p>This is backwards-incompatible if you were modifying <code class=\"docutils literal notranslate\">self.initial</code> in a\nmodel formset’s <code class=\"docutils literal notranslate\">__init__</code>, or if you relied on the internal\n<code class=\"docutils literal notranslate\">_total_form_count</code> or <code class=\"docutils literal notranslate\">_initial_form_count</code> attributes of BaseFormSet.\nThose attributes are now public methods.</p>\n</section>\n<section id=\"fixed-the-join-filter-s-escaping-behavior\">\n<h3>Fixed the <code class=\"docutils literal notranslate\">join</code> filter’s escaping behavior<a class=\"heading-anchor\" href=\"#fixed-the-join-filter-s-escaping-behavior\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-join\"><code class=\"xref std std-tfilter docutils literal notranslate\">join</code></a> filter no longer escapes the literal value that is\npassed in for the connector.</p>\n<p>This is backwards incompatible for the special situation of the literal string\ncontaining one of the five special HTML characters. Thus, if you were writing\n<code class=\"docutils literal notranslate\">{{ foo|join:&quot;&amp;&quot; }}</code>, you now have to write <code class=\"docutils literal notranslate\">{{ foo|join:&quot;&amp;amp;&quot; }}</code>.</p>\n<p>The previous behavior was a bug and contrary to what was documented\nand expected.</p>\n</section>\n<section id=\"permanent-redirects-and-the-redirect-to-generic-view\">\n<h3>Permanent redirects and the <code class=\"docutils literal notranslate\">redirect_to()</code> generic view<a class=\"heading-anchor\" href=\"#permanent-redirects-and-the-redirect-to-generic-view\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 1.1 adds a <code class=\"docutils literal notranslate\">permanent</code> argument to the\n<code class=\"docutils literal notranslate\">django.views.generic.simple.redirect_to()</code> view. This is technically\nbackwards-incompatible if you were using the <code class=\"docutils literal notranslate\">redirect_to</code> view with a\nformat-string key called ‘permanent’, which is highly unlikely.</p>\n</section>\n</section>\n<section id=\"features-deprecated-in-1-1\">\n<span id=\"deprecated-features-1-1\"></span><h2>Features deprecated in 1.1<a class=\"heading-anchor\" href=\"#features-deprecated-in-1-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>One feature has been marked as deprecated in Django 1.1:</p>\n<ul>\n<li><p>You should no longer use <code class=\"docutils literal notranslate\">AdminSite.root()</code> to register that admin\nviews. That is, if your URLconf contains the line:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^admin/(.*)&quot;</span><span class=\"p\">,</span> admin<span class=\"o\">.</span>site<span class=\"o\">.</span>root<span class=\"p\">),</span>\n</code></pre></div>\n<p>You should change it to read:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^admin/&quot;</span><span class=\"p\">,</span> include<span class=\"p\">(</span>admin<span class=\"o\">.</span>site<span class=\"o\">.</span>urls<span class=\"p\">)),</span>\n</code></pre></div>\n</li>\n</ul>\n<p>You should begin to remove use of this feature from your code immediately.</p>\n<p><code class=\"docutils literal notranslate\">AdminSite.root</code> will raise a <code class=\"docutils literal notranslate\">PendingDeprecationWarning</code> if used in\nDjango 1.1. This warning is hidden by default. In Django 1.2, this warning will\nbe upgraded to a <code class=\"docutils literal notranslate\">DeprecationWarning</code>, which will be displayed loudly. Django\n1.3 will remove <code class=\"docutils literal notranslate\">AdminSite.root()</code> entirely.</p>\n<p>For more details on our deprecation policies and strategy, see\n<a class=\"reference internal\" href=\"/en/dev/internals/release-process/\"><span class=\"doc\">Django’s release process</span></a>.</p>\n</section>\n<section id=\"what-s-new-in-django-1-1\">\n<span id=\"whats-new-1-1\"></span><h2>What’s new in Django 1.1<a class=\"heading-anchor\" href=\"#what-s-new-in-django-1-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Quite a bit: since Django 1.0, we’ve made 1,290 code commits, fixed 1,206 bugs,\nand added roughly 10,000 lines of documentation.</p>\n<p>The major new features in Django 1.1 are:</p>\n<section id=\"orm-improvements\">\n<h3>ORM improvements<a class=\"heading-anchor\" href=\"#orm-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Two major enhancements have been added to Django’s object-relational mapper\n(ORM): aggregate support, and query expressions.</p>\n<section id=\"aggregate-support\">\n<h4>Aggregate support<a class=\"heading-anchor\" href=\"#aggregate-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>It’s now possible to run SQL aggregate queries (i.e. <code class=\"docutils literal notranslate\">COUNT()</code>, <code class=\"docutils literal notranslate\">MAX()</code>,\n<code class=\"docutils literal notranslate\">MIN()</code>, etc.) from within Django’s ORM. You can choose to either return the\nresults of the aggregate directly, or else annotate the objects in a\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet\" title=\"django.db.models.query.QuerySet\"><code class=\"xref py py-class docutils literal notranslate\">QuerySet</code></a> with the results of the aggregate\nquery.</p>\n<p>This feature is available as new\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.aggregate\" title=\"django.db.models.query.QuerySet.aggregate\"><code class=\"xref py py-meth docutils literal notranslate\">aggregate()</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.annotate\" title=\"django.db.models.query.QuerySet.annotate\"><code class=\"xref py py-meth docutils literal notranslate\">annotate()</code></a> methods, and is covered in\ndetail in <a class=\"reference internal\" href=\"/en/dev/topics/db/aggregation/\"><span class=\"doc\">the ORM aggregation documentation</span></a>.</p>\n</section>\n<section id=\"query-expressions\">\n<h4>Query expressions<a class=\"heading-anchor\" href=\"#query-expressions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Queries can now refer to another field on the query and can traverse\nrelationships to refer to fields on related models. This is implemented in the\nnew <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.F\" title=\"django.db.models.F\"><code class=\"xref py py-class docutils literal notranslate\">F</code></a> object; for full details, including examples,\nconsult the <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.F\" title=\"django.db.models.F\"><code class=\"xref py py-class docutils literal notranslate\">F expressions documentation</code></a>.</p>\n</section>\n</section>\n<section id=\"model-improvements\">\n<h3>Model improvements<a class=\"heading-anchor\" href=\"#model-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>A number of features have been added to Django’s model layer:</p>\n<section id=\"unmanaged-models\">\n<h4>“Unmanaged” models<a class=\"heading-anchor\" href=\"#unmanaged-models\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>You can now control whether or not Django manages the life-cycle of the\ndatabase tables for a model using the <a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.managed\" title=\"django.db.models.Options.managed\"><code class=\"xref py py-attr docutils literal notranslate\">managed</code></a> model option.\nThis defaults to <code class=\"docutils literal notranslate\">True</code>, meaning that Django will create the appropriate\ndatabase tables in <code class=\"docutils literal notranslate\">syncdb</code> and remove them as part of the <code class=\"docutils literal notranslate\">reset</code> command.\nThat is, Django <em>manages</em> the database table’s lifecycle.</p>\n<p>If you set this to <code class=\"docutils literal notranslate\">False</code>, however, no database table creating or deletion\nwill be automatically performed for this model. This is useful if the model\nrepresents an existing table or a database view that has been created by some\nother means.</p>\n<p>For more details, see the documentation for the <a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.managed\" title=\"django.db.models.Options.managed\"><code class=\"xref py py-attr docutils literal notranslate\">managed</code></a>\noption.</p>\n</section>\n<section id=\"proxy-models\">\n<h4>Proxy models<a class=\"heading-anchor\" href=\"#proxy-models\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>You can now create <a class=\"reference internal\" href=\"/en/dev/topics/db/models/#proxy-models\"><span class=\"std std-ref\">proxy models</span></a>: subclasses of existing\nmodels that only add Python-level (rather than database-level) behavior and\naren’t represented by a new table. That is, the new model is a <em>proxy</em> for some\nunderlying model, which stores all the real data.</p>\n<p>All the details can be found in the <a class=\"reference internal\" href=\"/en/dev/topics/db/models/#proxy-models\"><span class=\"std std-ref\">proxy models documentation</span></a>. This feature is similar on the surface to unmanaged models,\nso the documentation has an explanation of <a class=\"reference internal\" href=\"/en/dev/topics/db/models/#proxy-vs-unmanaged-models\"><span class=\"std std-ref\">how proxy models differ from\nunmanaged models</span></a>.</p>\n</section>\n<section id=\"deferred-fields\">\n<h4>Deferred fields<a class=\"heading-anchor\" href=\"#deferred-fields\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>In some complex situations, your models might contain fields which could\ncontain a lot of data (for example, large text fields), or require expensive\nprocessing to convert them to Python objects. If you know you don’t need those\nparticular fields, you can now tell Django not to retrieve them from the\ndatabase.</p>\n<p>You’ll do this with the new queryset methods\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.defer\" title=\"django.db.models.query.QuerySet.defer\"><code class=\"xref py py-meth docutils literal notranslate\">defer()</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.only\" title=\"django.db.models.query.QuerySet.only\"><code class=\"xref py py-meth docutils literal notranslate\">only()</code></a>.</p>\n</section>\n</section>\n<section id=\"testing-improvements\">\n<h3>Testing improvements<a class=\"heading-anchor\" href=\"#testing-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>A few notable improvements have been made to the <a class=\"reference internal\" href=\"/en/dev/topics/testing/\"><span class=\"doc\">testing framework</span></a>.</p>\n<section id=\"test-performance-improvements\">\n<h4>Test performance improvements<a class=\"heading-anchor\" href=\"#test-performance-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Tests written using Django’s <a class=\"reference internal\" href=\"/en/dev/topics/testing/\"><span class=\"doc\">testing framework</span></a>\nnow run dramatically faster (as much as 10 times faster in many cases).</p>\n<p>This was accomplished through the introduction of transaction-based tests: when\nusing <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.TestCase\" title=\"django.test.TestCase\"><code class=\"xref py py-class docutils literal notranslate\">django.test.TestCase</code></a>, your tests will now be run in a\ntransaction which is rolled back when finished, instead of by flushing and\nre-populating the database. This results in an immense speedup for most types\nof unit tests. See the documentation for <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.TestCase\" title=\"django.test.TestCase\"><code class=\"xref py py-class docutils literal notranslate\">TestCase</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.TransactionTestCase\" title=\"django.test.TransactionTestCase\"><code class=\"xref py py-class docutils literal notranslate\">TransactionTestCase</code></a> for a full description, and some important notes\non database support.</p>\n</section>\n</section>\n<section id=\"test-client-improvements\">\n<h3>Test client improvements<a class=\"heading-anchor\" href=\"#test-client-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>A couple of small – but highly useful – improvements have been made to the\ntest client:</p>\n<ul class=\"simple\">\n<li><p>The test <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.Client\" title=\"django.test.Client\"><code class=\"xref py py-class docutils literal notranslate\">Client</code></a> now can automatically follow redirects with the\n<code class=\"docutils literal notranslate\">follow</code> argument to <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.Client.get\" title=\"django.test.Client.get\"><code class=\"xref py py-meth docutils literal notranslate\">Client.get()</code></a> and <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.Client.post\" title=\"django.test.Client.post\"><code class=\"xref py py-meth docutils literal notranslate\">Client.post()</code></a>. This\nmakes testing views that issue redirects simpler.</p></li>\n<li><p>It’s now easier to get at the template context in the response returned\nthe test client: you’ll simply access the context as\n<code class=\"docutils literal notranslate\">request.context[key]</code>. The old way, which treats <code class=\"docutils literal notranslate\">request.context</code> as\na list of contexts, one for each rendered template in the inheritance\nchain, is still available if you need it.</p></li>\n</ul>\n</section>\n<section id=\"new-admin-features\">\n<h3>New admin features<a class=\"heading-anchor\" href=\"#new-admin-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 1.1 adds a couple of nifty new features to Django’s admin interface:</p>\n<section id=\"editable-fields-on-the-change-list\">\n<h4>Editable fields on the change list<a class=\"heading-anchor\" href=\"#editable-fields-on-the-change-list\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>You can now make fields editable on the admin list views via the new\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#admin-list-editable\"><span class=\"std std-ref\">list_editable</span></a> admin option. These fields will show\nup as form widgets on the list pages, and can be edited and saved in bulk.</p>\n</section>\n<section id=\"admin-actions\">\n<h4>Admin “actions”<a class=\"heading-anchor\" href=\"#admin-actions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>You can now define <a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/actions/\"><span class=\"doc\">admin actions</span></a> that can\nperform some action to a group of models in bulk. Users will be able to select\nobjects on the change list page and then apply these bulk actions to all\nselected objects.</p>\n<p>Django ships with one pre-defined admin action to delete a group of objects in\none fell swoop.</p>\n</section>\n</section>\n<section id=\"conditional-view-processing\">\n<h3>Conditional view processing<a class=\"heading-anchor\" href=\"#conditional-view-processing\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django now has much better support for <a class=\"reference internal\" href=\"/en/dev/topics/conditional-view-processing/\"><span class=\"doc\">conditional view processing</span></a> using the standard <code class=\"docutils literal notranslate\">ETag</code> and\n<code class=\"docutils literal notranslate\">Last-Modified</code> HTTP headers. This means you can now easily short-circuit\nview processing by testing less-expensive conditions. For many views this can\nlead to a serious improvement in speed and reduction in bandwidth.</p>\n</section>\n<section id=\"url-namespaces\">\n<h3>URL namespaces<a class=\"heading-anchor\" href=\"#url-namespaces\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 1.1 improves <a class=\"reference internal\" href=\"/en/dev/topics/http/urls/#naming-url-patterns\"><span class=\"std std-ref\">named URL patterns</span></a> with the\nintroduction of URL “namespaces.”</p>\n<p>In short, this feature allows the same group of URLs, from the same\napplication, to be included in a Django URLConf multiple times, with varying\n(and potentially nested) named prefixes which will be used when performing\nreverse resolution. In other words, reusable applications like Django’s admin\ninterface may be registered multiple times without URL conflicts.</p>\n<p>For full details, see <a class=\"reference internal\" href=\"/en/dev/topics/http/urls/#topics-http-defining-url-namespaces\"><span class=\"std std-ref\">the documentation on defining URL namespaces</span></a>.</p>\n</section>\n<section id=\"geodjango\">\n<h3>GeoDjango<a class=\"heading-anchor\" href=\"#geodjango\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>In Django 1.1, <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/\"><span class=\"doc\">GeoDjango</span></a> (i.e.\n<code class=\"docutils literal notranslate\">django.contrib.gis</code>) has several new features:</p>\n<ul class=\"simple\">\n<li><p>Support for <a class=\"reference external\" href=\"https://www.gaia-gis.it/gaia-sins/\">SpatiaLite</a> – a spatial database for SQLite – as a spatial\nbackend.</p></li>\n<li><p>Geographic aggregates (<code class=\"docutils literal notranslate\">Collect</code>, <code class=\"docutils literal notranslate\">Extent</code>, <code class=\"docutils literal notranslate\">MakeLine</code>, <code class=\"docutils literal notranslate\">Union</code>)\nand <code class=\"docutils literal notranslate\">F</code> expressions.</p></li>\n<li><p>New <code class=\"docutils literal notranslate\">GeoQuerySet</code> methods: <code class=\"docutils literal notranslate\">collect</code>, <code class=\"docutils literal notranslate\">geojson</code>, and\n<code class=\"docutils literal notranslate\">snap_to_grid</code>.</p></li>\n<li><p>A new list interface methods for <code class=\"docutils literal notranslate\">GEOSGeometry</code> objects.</p></li>\n</ul>\n<p>For more details, see the GeoDjango documentation.</p>\n</section>\n<section id=\"other-improvements\">\n<h3>Other improvements<a class=\"heading-anchor\" href=\"#other-improvements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Other new features and changes introduced since Django 1.0 include:</p>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/csrf/\"><span class=\"doc\">CSRF protection middleware</span></a> has been split into\ntwo classes – <code class=\"docutils literal notranslate\">CsrfViewMiddleware</code> checks incoming requests, and\n<code class=\"docutils literal notranslate\">CsrfResponseMiddleware</code> processes outgoing responses. The combined\n<code class=\"docutils literal notranslate\">CsrfMiddleware</code> class (which does both) remains for\nbackwards-compatibility, but using the split classes is now recommended in\norder to allow fine-grained control of when and where the CSRF processing\ntakes place.</p></li>\n<li><p><code class=\"docutils literal notranslate\">reverse()</code> and code which uses it (e.g., the <code class=\"docutils literal notranslate\">{% url %}</code> template tag)\nnow works with URLs in Django’s administrative site, provided that the admin\nURLs are set up via <code class=\"docutils literal notranslate\">include(admin.site.urls)</code> (sending admin requests to\nthe <code class=\"docutils literal notranslate\">admin.site.root</code> view still works, but URLs in the admin will not be\n“reversible” when configured this way).</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">include()</code> function in Django URLconf modules can now accept sequences\nof URL patterns (generated by <code class=\"docutils literal notranslate\">patterns()</code>) in addition to module names.</p></li>\n<li><p>Instances of Django forms (see <a class=\"reference internal\" href=\"/en/dev/topics/forms/\"><span class=\"doc\">the forms overview</span></a>) now have two additional methods, <code class=\"docutils literal notranslate\">hidden_fields()</code>\nand <code class=\"docutils literal notranslate\">visible_fields()</code>, which return the list of hidden – i.e.,\n<code class=\"docutils literal notranslate\">&lt;input type=&quot;hidden&quot;&gt;</code> – and visible fields on the form, respectively.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">redirect_to</code> generic view\nnow accepts an additional keyword argument <code class=\"docutils literal notranslate\">permanent</code>. If <code class=\"docutils literal notranslate\">permanent</code> is\n<code class=\"docutils literal notranslate\">True</code>, the view will emit an HTTP permanent redirect (status code 301). If\n<code class=\"docutils literal notranslate\">False</code>, the view will emit an HTTP temporary redirect (status code 302).</p></li>\n<li><p>A new database lookup type – <code class=\"docutils literal notranslate\">week_day</code> – has been added for\n<code class=\"docutils literal notranslate\">DateField</code> and <code class=\"docutils literal notranslate\">DateTimeField</code>. This type of lookup accepts a number\nbetween 1 (Sunday) and 7 (Saturday), and returns objects where the field\nvalue matches that day of the week. See <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#field-lookups\"><span class=\"std std-ref\">the full list of lookup types</span></a> for details.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">{% for %}</code> tag in Django’s template language now accepts an optional\n<code class=\"docutils literal notranslate\">{% empty %}</code> clause, to be displayed when <code class=\"docutils literal notranslate\">{% for %}</code> is asked to loop\nover an empty sequence. See <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/\"><span class=\"doc\">the list of built-in template tags</span></a> for examples of this.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\">dumpdata</code></a> management command now accepts individual\nmodel names as arguments, allowing you to export the data just from\nparticular models.</p></li>\n<li><p>There’s a new <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-safeseq\"><code class=\"xref std std-tfilter docutils literal notranslate\">safeseq</code></a> template filter which works just like\n<a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-safe\"><code class=\"xref std std-tfilter docutils literal notranslate\">safe</code></a> for lists, marking each item in the list as safe.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/cache/\"><span class=\"doc\">Cache backends</span></a> now support <code class=\"docutils literal notranslate\">incr()</code> and\n<code class=\"docutils literal notranslate\">decr()</code> commands to increment and decrement the value of a cache key.\nOn cache backends that support atomic increment/decrement – most\nnotably, the memcached backend – these operations will be atomic, and\nquite fast.</p></li>\n<li><p>Django now can <a class=\"reference internal\" href=\"/en/dev/howto/auth-remote-user/\"><span class=\"doc\">easily delegate authentication to the web server</span></a> via a new authentication backend that supports\nthe standard <code class=\"docutils literal notranslate\">REMOTE_USER</code> environment variable used for this purpose.</p></li>\n<li><p>There’s a new <a class=\"reference internal\" href=\"/en/dev/topics/http/shortcuts/#django.shortcuts.redirect\" title=\"django.shortcuts.redirect\"><code class=\"xref py py-func docutils literal notranslate\">django.shortcuts.redirect()</code></a> function that makes it\neasier to issue redirects given an object, a view name, or a URL.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">postgresql_psycopg2</code> backend now supports <a class=\"reference internal\" href=\"/en/dev/ref/databases/#postgresql-notes\"><span class=\"std std-ref\">native PostgreSQL\nautocommit</span></a>. This is an advanced, PostgreSQL-specific\nfeature, that can make certain read-heavy applications a good deal\nfaster.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"what-s-next\">\n<h2>What’s next?<a class=\"heading-anchor\" href=\"#what-s-next\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>We’ll take a short break, and then work on Django 1.2 will begin – no rest for\nthe weary! If you’d like to help, discussion of Django development, including\nprogress toward the 1.2 release, takes place daily on the <a class=\"reference internal\" href=\"/en/dev/internals/mailing-lists/#django-developers-mailing-list\"><span class=\"std std-ref\">django-developers</span></a>\nmailing list and in the <code class=\"docutils literal notranslate\">#django-dev</code> IRC channel on <code class=\"docutils literal notranslate\">irc.libera.chat</code>.\nFeel free to join the discussions!</p>\n<p>Django’s online documentation also includes pointers on how to contribute to\nDjango:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/internals/contributing/\"><span class=\"doc\">How to contribute to Django</span></a></p></li>\n</ul>\n<p>Contributions on any level – developing code, writing documentation or simply\ntriaging tickets and helping to test proposed bugfixes – are always welcome\nand appreciated.</p>\n<p>And that’s the way it is.</p>\n</section>","rootId":"django-1-1-release-notes","toc":[{"title":"Backwards-incompatible changes in 1.1","anchor":"backwards-incompatible-changes-in-1-1","children":[{"title":"Changes to constraint names","anchor":"changes-to-constraint-names","children":[]},{"title":"Test cases are now run in a transaction","anchor":"test-cases-are-now-run-in-a-transaction","children":[]},{"title":"Removed SetRemoteAddrFromForwardedFor middleware","anchor":"removed-setremoteaddrfromforwardedfor-middleware","children":[]},{"title":"Names of uploaded files are available later","anchor":"names-of-uploaded-files-are-available-later","children":[]},{"title":"Changes to how model formsets are saved","anchor":"changes-to-how-model-formsets-are-saved","children":[]},{"title":"Fixed the join filter’s escaping behavior","anchor":"fixed-the-join-filter-s-escaping-behavior","children":[]},{"title":"Permanent redirects and the redirect_to() generic view","anchor":"permanent-redirects-and-the-redirect-to-generic-view","children":[]}]},{"title":"Features deprecated in 1.1","anchor":"features-deprecated-in-1-1","children":[]},{"title":"What’s new in Django 1.1","anchor":"what-s-new-in-django-1-1","children":[{"title":"ORM improvements","anchor":"orm-improvements","children":[{"title":"Aggregate support","anchor":"aggregate-support","children":[]},{"title":"Query expressions","anchor":"query-expressions","children":[]}]},{"title":"Model improvements","anchor":"model-improvements","children":[{"title":"“Unmanaged” models","anchor":"unmanaged-models","children":[]},{"title":"Proxy models","anchor":"proxy-models","children":[]},{"title":"Deferred fields","anchor":"deferred-fields","children":[]}]},{"title":"Testing improvements","anchor":"testing-improvements","children":[{"title":"Test performance improvements","anchor":"test-performance-improvements","children":[]}]},{"title":"Test client improvements","anchor":"test-client-improvements","children":[]},{"title":"New admin features","anchor":"new-admin-features","children":[{"title":"Editable fields on the change list","anchor":"editable-fields-on-the-change-list","children":[]},{"title":"Admin “actions”","anchor":"admin-actions","children":[]}]},{"title":"Conditional view processing","anchor":"conditional-view-processing","children":[]},{"title":"URL namespaces","anchor":"url-namespaces","children":[]},{"title":"GeoDjango","anchor":"geodjango","children":[]},{"title":"Other improvements","anchor":"other-improvements","children":[]}]},{"title":"What’s next?","anchor":"what-s-next","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.1.2","title":"Django 1.1.2 release notes","url":"/en/dev/releases/1.1.2/"},"next":{"docname":"releases/1.0.2","title":"Django 1.0.2 release notes","url":"/en/dev/releases/1.0.2/"},"formats":{"html":"/en/dev/releases/1.1/","markdown":"/en/dev/releases/1.1.md","json":"/en/dev/releases/1.1.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.1.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.1/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9","1.8"],"inLocales":["en"]}