|
| 1 | +.. _releases-1.2-beta-1: |
| 2 | + |
| 3 | +=============================== |
| 4 | +Django 1.2 beta 1 release notes |
| 5 | +=============================== |
| 6 | + |
| 7 | +February 5, 2010 |
| 8 | + |
| 9 | +Welcome to Django 1.2 beta 1! |
| 10 | + |
| 11 | +This is the second in a series of preview/development releases leading |
| 12 | +up to the eventual release of Django 1.2, currently scheduled to take |
| 13 | +place in March 2010. This release is primarily targeted at developers |
| 14 | +who are interested in trying out new features and testing the Django |
| 15 | +codebase to help identify and resolve bugs prior to the final 1.2 |
| 16 | +release. |
| 17 | + |
| 18 | +As such, this release is *not* intended for production use, and any |
| 19 | +such use is discouraged. |
| 20 | + |
| 21 | +This document covers changes since the Django 1.2 alpha release; the |
| 22 | +:ref:`1.2 alpha release notes <releases-1.2-alpha-1>` cover new and |
| 23 | +updated features in Django between 1.1 and 1.2 alpha. |
| 24 | + |
| 25 | + |
| 26 | +What's new in 1.2 beta |
| 27 | +====================== |
| 28 | + |
| 29 | +This 1.2 beta release marks the final feature freeze for Django 1.2; |
| 30 | +while most feature development was completed for 1.2 alpha (which |
| 31 | +constituted a freeze on major features), a few other new features were |
| 32 | +added afterward and so are new as of 1.2 beta. |
| 33 | + |
| 34 | +Additionally, some existing APIs have been deprecated; under `our API |
| 35 | +stability policy <misc-api-stability>`, these APIs will continue to |
| 36 | +work for now, but will raise ``PendingDeprecationWarning`` in Django |
| 37 | +1.2 and ``DeprecationWarning`` in Django 1.3, before being removed in |
| 38 | +Django 1.4. |
| 39 | + |
| 40 | + |
| 41 | +Class-based test runners |
| 42 | +------------------------ |
| 43 | + |
| 44 | +Django 1.2 changes the test runner tools to use a class-based |
| 45 | +approach. Old style function-based test runners will still work, but |
| 46 | +should be updated to use the new :ref:`class-based runners |
| 47 | +<topics-testing-test_runner>`. |
| 48 | + |
| 49 | + |
| 50 | +``Feed`` in ``django.contrib.syndication.feeds`` |
| 51 | +------------------------------------------------ |
| 52 | + |
| 53 | +The :class:`django.contrib.syndication.feeds.Feed` class is being |
| 54 | +replaced by the :class:`django.contrib.syndication.views.Feed` class. |
| 55 | +The old ``feeds.Feed`` class is deprecated, and will be removed in |
| 56 | +Django 1.4. |
| 57 | + |
| 58 | +The new class has an almost identical API, but allows instances to be |
| 59 | +used as views. For example, consider the use of the old framework in |
| 60 | +the following :ref:`URLconf <topics-http-urls>`:: |
| 61 | + |
| 62 | + from django.conf.urls.defaults import * |
| 63 | + from myproject.feeds import LatestEntries, LatestEntriesByCategory |
| 64 | + |
| 65 | + feeds = { |
| 66 | + 'latest': LatestEntries, |
| 67 | + 'categories': LatestEntriesByCategory, |
| 68 | + } |
| 69 | + |
| 70 | + urlpatterns = patterns('', |
| 71 | + # ... |
| 72 | + (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', |
| 73 | + {'feed_dict': feeds}), |
| 74 | + # ... |
| 75 | + ) |
| 76 | + |
| 77 | +Using the new Feed class, these feeds can be deployed directly as views:: |
| 78 | + |
| 79 | + from django.conf.urls.defaults import * |
| 80 | + from myproject.feeds import LatestEntries, LatestEntriesByCategory |
| 81 | + |
| 82 | + urlpatterns = patterns('', |
| 83 | + # ... |
| 84 | + (r'^feeds/latest/$', LatestEntries()), |
| 85 | + (r'^feeds/categories/(?P<category_id>\d+)/$', LatestEntriesByCategory()), |
| 86 | + # ... |
| 87 | + ) |
| 88 | + |
| 89 | +If you currently use the ``feed()`` view, the ``LatestEntries`` class |
| 90 | +would not need to be modified apart from subclassing the new |
| 91 | +:class:`~django.contrib.syndication.views.Feed` class. |
| 92 | + |
| 93 | +However, ``LatestEntriesByCategory`` uses the ``get_object()`` method |
| 94 | +with the ``bits`` argument to specify a specific category to show. In |
| 95 | +the new :class:`~django.contrib.syndication.views.Feed` class, |
| 96 | +``get_object()`` method takes a ``request`` and arguments from the |
| 97 | +URL, so it would look like this:: |
| 98 | + |
| 99 | + from django.contrib.syndication.views import Feed |
| 100 | + from django.shortcuts import get_object_or_404 |
| 101 | + from myproject.models import Category |
| 102 | + |
| 103 | + class LatestEntriesByCategory(Feed): |
| 104 | + def get_object(self, request, category_id): |
| 105 | + return get_object_or_404(Category, id=category_id) |
| 106 | + |
| 107 | + # ... |
| 108 | + |
| 109 | +Additionally, the ``get_feed()`` method on ``Feed`` classes now take |
| 110 | +different arguments, which may impact you if you use the ``Feed`` |
| 111 | +classes directly. Instead of just taking an optional ``url`` argument, |
| 112 | +it now takes two arguments: the object returned by its own |
| 113 | +``get_object()`` method, and the current ``request`` object. |
| 114 | + |
| 115 | +To take into account ``Feed`` classes not being initialized for each |
| 116 | +request, the ``__init__()`` method now takes no arguments by default. |
| 117 | +Previously it would have taken the ``slug`` from the URL and the |
| 118 | +``request`` object. |
| 119 | + |
| 120 | +In accordance with `RSS best practices`_, RSS feeds will now include |
| 121 | +an ``atom:link`` element. You may need to update your tests to take |
| 122 | +this into account. |
| 123 | + |
| 124 | +For more information, see the full :ref:`syndication framework |
| 125 | +documentation <ref-contrib-syndication>`. |
| 126 | + |
| 127 | +.. _RSS best practices: http://www.rssboard.org/rss-profile |
| 128 | + |
| 129 | + |
| 130 | +Cookie encoding |
| 131 | +--------------- |
| 132 | + |
| 133 | +Due to cookie-handling bugs in Internet Explorer, Safari, and possibly |
| 134 | +other browsers, our encoding of cookie values was changed so that the |
| 135 | +characters comma (',') and semi-colon (';') are treated as non-safe |
| 136 | +characters, and are therefore encoded as ``\054`` and ``\073`` |
| 137 | +respectively. This could produce backwards incompatibilities if you |
| 138 | +are relying on the ability to set these characters directly in cookie |
| 139 | +values. |
| 140 | + |
| 141 | + |
| 142 | +Object-level permissions |
| 143 | +------------------------ |
| 144 | + |
| 145 | +A foundation for specifying permissions at the per-object level has |
| 146 | +been added. The default authentication backends shipped with Django do |
| 147 | +not make use of this, but third-party authentication backends are free |
| 148 | +to do so. See the :ref:`authentication docs <topics-auth>` for more |
| 149 | +information. |
| 150 | + |
| 151 | +Permissions for anonymous users |
| 152 | +------------------------------- |
| 153 | + |
| 154 | +If you provide a custom authentication backend with the attribute |
| 155 | +``supports_anonymous_user`` set to ``True``, the ``AnonymousUser`` |
| 156 | +class will check the backend for permissions, just as the normal |
| 157 | +``User`` does. This is intended to help centralize permission |
| 158 | +handling; apps can always delegate the question of whether something |
| 159 | +is allowed or not to the authorization/authentication system. See the |
| 160 | +:ref:`authentication docs <topics-auth>` for more details. |
| 161 | + |
| 162 | + |
| 163 | +The Django 1.2 roadmap |
| 164 | +====================== |
| 165 | + |
| 166 | +Before the final Django 1.2 release, at least one additional |
| 167 | +preview/development releases will be made available. The current |
| 168 | +schedule consists of at least the following: |
| 169 | + |
| 170 | +* Week of **March 2, 2010**: First Django 1.2 release |
| 171 | + candidate. String freeze for translations. |
| 172 | + |
| 173 | +* Week of **March 9, 2010**: Django 1.2 final release. |
| 174 | + |
| 175 | +If necessary, additional beta or release-candidate packages will be |
| 176 | +issued prior to the final 1.2 release. Django 1.2 will be released |
| 177 | +approximately one week after the final release candidate. |
| 178 | + |
| 179 | + |
| 180 | +What you can do to help |
| 181 | +======================= |
| 182 | + |
| 183 | +In order to provide a high-quality 1.2 release, we need your |
| 184 | +help. Although this beta release is, again, *not* intended for |
| 185 | +production use, you can help the Django team by trying out the beta |
| 186 | +codebase in a safe test environment and reporting any bugs or issues |
| 187 | +you encounter. The Django ticket tracker is the central place to |
| 188 | +search for open issues: |
| 189 | + |
| 190 | + * http://code.djangoproject.com/timeline |
| 191 | + |
| 192 | +Please open new tickets if no existing ticket corresponds to a problem |
| 193 | +you're running into. |
| 194 | + |
| 195 | +Additionally, discussion of Django development, including progress |
| 196 | +toward the 1.2 release, takes place daily on the django-developers |
| 197 | +mailing list: |
| 198 | + |
| 199 | + * http://groups.google.com/group/django-developers |
| 200 | + |
| 201 | +... and in the ``#django-dev`` IRC channel on ``irc.freenode.net``. If |
| 202 | +... you're |
| 203 | +interested in helping out with Django's development, feel free to join the |
| 204 | +discussions there. |
| 205 | + |
| 206 | +Django's online documentation also includes pointers on how to |
| 207 | +contribute to Django: |
| 208 | + |
| 209 | + * :ref:`How to contribute to Django <internals-contributing>` |
| 210 | + |
| 211 | +Contributions on any level -- developing code, writing documentation |
| 212 | +or simply triaging tickets and helping to test proposed bugfixes -- |
| 213 | +are always welcome and appreciated. |
| 214 | + |
| 215 | +Development sprints for Django 1.2 will also be taking place at PyCon |
| 216 | +US 2010, on the dedicated sprint days (February 22 through 25), and |
| 217 | +anyone who wants to help out is welcome to join in, either in person |
| 218 | +at PyCon or virtually in the IRC channel or on the mailing list. |
0 commit comments