@@ -6,15 +6,16 @@ Welcome to Django 0.96!
6
6
7
7
The primary goal for 0.96 is a cleanup and stabilization of the features
8
8
introduced in 0.95. There have been a few small `backwards-incompatible
9
- changes`_ since 0.95, but nearly all changes shouldn't require any major
10
- updates .
9
+ changes`_ since 0.95, but the upgrade process should be fairly simple
10
+ and should not require major changes to existing applications .
11
11
12
12
However, we're also releasing 0.96 now because we have a set of
13
- backwards-incompatible changes scheduled for the near future. These changes are
14
- will require code changes for developers tracking the Django development
15
- version, so if you're looking for a rock-solid, stable, version of Django we
16
- recommend you stick with Django until the next official release and upgrade all
17
- at once.
13
+ backwards-incompatible changes scheduled for the near future. Once
14
+ completed, they will involve some code changes for application
15
+ developers, so we recommend that you stick with Django 0.96 until the
16
+ next official release; then you'll be able to upgrade in one step
17
+ instead of needing to make incremental changes to keep up with the
18
+ development version of Django.
18
19
19
20
What's new in 0.96?
20
21
===================
@@ -26,34 +27,35 @@ most notable changes in this release.
26
27
New forms library
27
28
-----------------
28
29
29
- ``django.newforms`` is Django's fantastic new form-handling library. It's a
30
- replacement for ``django.forms``, the old form/manipulator/validation framework.
31
- Both APIs are available in 0.96, but over the next two releases we plan to
32
- completely replace the old forms framework with this new one.
30
+ ``django.newforms`` is Django's new form-handling library. It's a
31
+ replacement for ``django.forms``, the old form/manipulator/validation
32
+ framework. Both APIs are available in 0.96, but over the next two
33
+ releases we plan to switch completely to the new forms system, and
34
+ deprecate and remove the old system.
33
35
34
- Our transition plan is :
36
+ There are three elements to this transition :
35
37
36
- * We've copied the current ``django.forms`` to ``django.oldforms``. This
37
- allows you to upgrade your code *now* rather than waiting for the
38
- backwards-incompatible change and rushing to fix your code after the fact.
39
- Just change your import statements like this::
38
+ * We've copied the current ``django.forms`` to
39
+ ``django.oldforms``. This allows you to upgrade your code *now*
40
+ rather than waiting for the backwards-incompatible change and
41
+ rushing to fix your code after the fact. Just change your
42
+ import statements like this::
40
43
41
44
from django import forms # 0.95-style
42
45
from django import oldforms as forms # 0.96-style
43
46
44
- * Before the next release, we will move the current ``django.newforms`` to
45
- ``django.forms``. This will be a backwards-incompatible change, and
46
- anybody who is still using the old version of ``django.forms`` at that
47
- time will need to change their import statements, as described in the
48
- previous bullet .
47
+ * The next official release of Django will move the current
48
+ ``django.newforms`` to ``django. forms``. This will be a
49
+ backwards-incompatible change, and anyone still using the old
50
+ version of ``django.forms`` at that time will need to change
51
+ their import statements as described above .
49
52
50
- * We will remove ``django.oldforms`` in the release *after* the next Django
51
- release -- the release that comes after the release in which we're
52
- creating the new ``django.forms``.
53
+ * The next release after that will completely remove
54
+ ``django.oldforms``.
53
55
54
56
Although the ``newforms`` library will continue to evolve, it's ready for use
55
57
for most common cases. We recommend that anyone new to form handling skip the
56
- old forms and start with the new.
58
+ old forms system and start with the new.
57
59
58
60
For more information about ``django.newforms``, read the `newforms
59
61
documentation`_.
@@ -82,9 +84,10 @@ can now be rewritten as::
82
84
('^myview/$', myview)
83
85
)
84
86
85
- A very useful application of this can be seen when using decorators: this change
86
- allows you to apply decorators to views *in your URLconf*. Thus, you can make a
87
- generic view require login very easily::
87
+ One useful application of this can be seen when using decorators; this
88
+ change allows you to apply decorators to views *in your
89
+ URLconf*. Thus, you can make a generic view require login very
90
+ easily::
88
91
89
92
from django.conf.urls.defaults import *
90
93
from django.contrib.auth.decorators import login_required
@@ -109,8 +112,8 @@ Django now includes a test framework so you can start transmuting fear into
109
112
boredom (with apologies to Kent Beck). You can write tests based on doctest_
110
113
or unittest_ and test your views with a simple test client.
111
114
112
- There is also new support for "fixtures" -- initial data stored in any of the
113
- supported `serialization formats`_ that will be loaded into your database at the
115
+ There is also new support for "fixtures" -- initial data, stored in any of the
116
+ supported `serialization formats`_, that will be loaded into your database at the
114
117
start of your tests. This makes testing with real data much easier.
115
118
116
119
See `the testing documentation`_ for the full details.
@@ -120,61 +123,93 @@ See `the testing documentation`_ for the full details.
120
123
.. _the testing documentation: ../testing/
121
124
.. _serialization formats: ../serialization/
122
125
126
+ Improvements to the admin interface
127
+ -----------------------------------
123
128
124
- Improvements to the user admin interface
125
- ----------------------------------------
126
-
127
- A small change, but a very nice one: you no longer need to edit MD5 hashes when
128
- creating and/or updating users from the admin interface.
129
-
130
- Django is now hash-free for over a thousand revisions!
129
+ A small change, but a very nice one: dedicated views for adding and
130
+ updating users have been added to the admin interface, so you no
131
+ longer need to worry about working with hashed passwords in the admin.
131
132
132
133
Backwards-incompatible changes
133
134
==============================
134
135
135
136
The following changes may require you to update your code when you switch from
136
137
0.95 to 0.96:
137
138
139
+ `MySQLdb` version requirement
140
+ -----------------------------
141
+
142
+ Due to a bug in older versions of the `MySQLdb` Python module (which
143
+ Django uses to connect to MySQL databases), Django's MySQL backend now
144
+ requires version 1.2.1p2 or higher of `MySQLdb`, and will raise
145
+ exceptions if you attempt to use an older version.
146
+
147
+ If you're currently unable to upgrade your copy of `MySQLdb` to meet
148
+ this requirement, a separate, backwards-compatible backend, called
149
+ "mysql_old", has been added to Django. To use this backend, change
150
+ the ``DATABASE_ENGINE`` setting in your Django settings file from
151
+ this::
152
+
153
+ DATABASE_ENGINE = "mysql"
154
+
155
+ to this::
156
+
157
+ DATABASE_ENGINE = "mysql_old"
158
+
159
+ However, we strongly encourage MySQL users to upgrade to a more recent
160
+ version of `MySQLdb` as soon as possible, The "mysql_old" backend is
161
+ provided only to ease this transition, and is considered deprecated;
162
+ aside from any necessary security fixes, it will not be actively
163
+ maintained, and it will be removed in a future release of Django.
164
+
165
+
138
166
Database constraint names changed
139
167
---------------------------------
140
168
141
- The format of the constraint names Django generates for foreign key references
142
- changed slightly. These names are only used sometimes, when it is not possible
143
- to put the reference directly on the affected column, so this is not always
144
- visible.
169
+ The format of the constraint names Django generates for foreign key
170
+ references have changed slightly. These names are generally only used
171
+ when it is not possible to put the reference directly on the affected
172
+ column, so they is not always visible.
145
173
146
- The effect of this change is that ``manage.py reset`` and similar commands may
147
- generate SQL with new constraint names and thus generate an error when run
148
- against the database (the database server will complain about the constraint not
149
- existing). To fix this, you will need to tweak the output of ``manage.py``
150
- to match the correct constraint names and pass the results to the
151
- database server manually.
174
+ The effect of this change is that running ``manage.py reset`` and
175
+ similar commands against an existing database may generate SQL with
176
+ the new form of constraint name, while the database itself contains
177
+ constraints named in the old form; this will cause the database server
178
+ to raise an error message about modifying non-existent constraints.
152
179
153
- You can also fix this by examining the output of ``manage.py sqlall`` and
154
- renaming database constraints to match the new naming scheme.
180
+ If you need to work around this, there are two methods available:
181
+
182
+ 1. Redirect the output of ``manage.py`` to a file, and edit the
183
+ generated SQL to use the correct constraint names before
184
+ executing it.
185
+
186
+ 2. Examine the output of ``manage.py sqlall`` to see the new-style
187
+ constraint names, and use that as a guide to rename existing
188
+ constraints in your database.
155
189
156
190
Names changes in ``manage.py``
157
191
------------------------------
158
192
159
193
A few of the options to ``manage.py`` have changed with the addition of fixture
160
194
support:
161
195
162
- * There are new ``dumpdata`` and ``loaddata`` commands, which, as you might
163
- expect, will dump and load data to/from the database. These targets
164
- operate against one of the serialization formats.
196
+ * There are new ``dumpdata`` and ``loaddata`` commands which, as
197
+ you might expect, will dump and load data to/from the
198
+ database. These commands can operate against any of Django's
199
+ supported serialization formats.
165
200
166
- * The ``sqlinitialdata`` target has been renamed to ``sqlcustom`` to
201
+ * The ``sqlinitialdata`` command has been renamed to ``sqlcustom`` to
167
202
emphasize that ``loaddata`` should be used for data (and ``sqlcustom`` for
168
203
other custom SQL -- views, stored procedures, etc.).
169
204
170
- * The vestigal ``install`` target is gone . Use ``syncdb``.
205
+ * The vestigial ``install`` command has been removed . Use ``syncdb``.
171
206
172
207
Backslash escaping changed
173
208
--------------------------
174
209
175
210
The Django database API now escapes backslashes given as query parameters. If
176
- you have any database API code that match backslashes, and it was working before
177
- (despite the broken escaping), you'll have to change your code to "unescape" the
211
+ you have any database API code that matches backslashes, and it was working before
212
+ (despite the lack of escaping), you'll have to change your code to "unescape" the
178
213
slashes one level.
179
214
180
215
For example, this used to work::
@@ -191,18 +226,17 @@ Removed ENABLE_PSYCO setting
191
226
----------------------------
192
227
193
228
The ``ENABLE_PSYCO`` setting no longer exists. If your settings file includes
194
- ``ENABLE_PSYCO``, nothing will break per se, but it just won't do anything.
195
-
196
- If you want to use Psyco_ with Django, you'll need to write some custom
197
- middleware that activates Psyco.
229
+ ``ENABLE_PSYCO`` it will have no effect; to use Psyco, we recommend
230
+ writing a middleware class to activate it.
198
231
199
232
.. _psyco: http://psyco.sourceforge.net/
200
233
201
234
Thanks
202
235
======
203
236
204
- Since 0.95, a number of people have stepped forward and taken a major new role in Django's development. We'd like to thank these
205
- people for all their hard work:
237
+ Since 0.95, a number of people have stepped forward and taken a major
238
+ new role in Django's development. We'd like to thank these people for
239
+ all their hard work:
206
240
207
241
* Russell Keith-Magee and Malcolm Tredinnick for their major code
208
242
contributions. This release wouldn't have been possible without them.
0 commit comments