1.0.txt 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. ========================
  2. Django 1.0 release notes
  3. ========================
  4. Welcome to Django 1.0!
  5. We've been looking forward to this moment for over three years, and it's finally
  6. here. Django 1.0 represents the largest milestone in Django's development to
  7. date: a Web framework that a group of perfectionists can truly be proud of.
  8. Django 1.0 represents over three years of community development as an Open
  9. Source project. Django's received contributions from hundreds of developers,
  10. been translated into fifty languages, and today is used by developers on every
  11. continent and in every kind of job.
  12. An interesting historical note: when Django was first released in July 2005, the
  13. initial released version of Django came from an internal repository at revision
  14. number 8825. Django 1.0 represents revision 8961 of our public repository. It
  15. seems fitting that our 1.0 release comes at the moment where community
  16. contributions overtake those made privately.
  17. Stability and forwards-compatibility
  18. ====================================
  19. The release of Django 1.0 comes with a promise of API
  20. stability and forwards-compatibility. In a nutshell, this means that code you
  21. develop against Django 1.0 will continue to work against 1.1 unchanged, and you
  22. should need to make only minor changes for any 1.X release.
  23. See the :doc:`API stability guide </misc/api-stability>` for full details.
  24. Backwards-incompatible changes
  25. ==============================
  26. Django 1.0 has a number of backwards-incompatible changes from Django 0.96. If
  27. you have apps written against Django 0.96 that you need to port, see our
  28. detailed porting guide:
  29. .. toctree::
  30. :maxdepth: 1
  31. 1.0-porting-guide
  32. A complete list of backwards-incompatible changes can be found at
  33. https://code.djangoproject.com/wiki/BackwardsIncompatibleChanges.
  34. What's new in Django 1.0
  35. ========================
  36. A *lot*!
  37. Since Django 0.96, we've made over 4,000 code commits, fixed more than 2,000
  38. bugs, and edited, added, or removed around 350,000 lines of code. We've also
  39. added 40,000 lines of new documentation, and greatly improved what was already
  40. there.
  41. In fact, new documentation is one of our favorite features of Django 1.0, so we
  42. might as well start there. First, there's a new documentation site:
  43. * https://docs.djangoproject.com/
  44. The documentation has been greatly improved, cleaned up, and generally made
  45. awesome. There's now dedicated search, indexes, and more.
  46. We can't possibly document everything that's new in 1.0, but the documentation
  47. will be your definitive guide. Anywhere you see something like:
  48. .. versionadded:: 1.0
  49. This feature is new in Django 1.0
  50. You'll know that you're looking at something new or changed.
  51. The other major highlights of Django 1.0 are:
  52. Re-factored admin application
  53. -----------------------------
  54. The Django administrative interface (``django.contrib.admin``) has been
  55. completely refactored; admin definitions are now completely decoupled from model
  56. definitions (no more ``class Admin`` declaration in models!), rewritten to use
  57. Django's new form-handling library (introduced in the 0.96 release as
  58. ``django.newforms``, and now available as simply ``django.forms``) and
  59. redesigned with extensibility and customization in mind. Full documentation for
  60. the admin application is available online in the official Django documentation:
  61. See the :doc:`admin reference </ref/contrib/admin/index>` for details
  62. Improved Unicode handling
  63. -------------------------
  64. Django's internals have been refactored to use Unicode throughout; this
  65. drastically simplifies the task of dealing with non-Western-European content and
  66. data in Django. Additionally, utility functions have been provided to ease
  67. interoperability with third-party libraries and systems which may or may not
  68. handle Unicode gracefully. Details are available in Django's Unicode-handling
  69. documentation.
  70. See :doc:`/ref/unicode`.
  71. An improved ORM
  72. ---------------
  73. Django's object-relational mapper -- the component which provides the mapping
  74. between Django model classes and your database, and which mediates your database
  75. queries -- has been dramatically improved by a massive refactoring. For most
  76. users of Django this is backwards-compatible; the public-facing API for database
  77. querying underwent a few minor changes, but most of the updates took place in
  78. the ORM's internals. A guide to the changes, including backwards-incompatible
  79. modifications and mentions of new features opened up by this refactoring, is
  80. `available on the Django wiki`__.
  81. __ https://code.djangoproject.com/wiki/QuerysetRefactorBranch
  82. Automatic escaping of template variables
  83. ----------------------------------------
  84. To provide improved security against cross-site scripting (XSS) vulnerabilities,
  85. Django's template system now automatically escapes the output of variables. This
  86. behavior is configurable, and allows both variables and larger template
  87. constructs to be marked as safe (requiring no escaping) or unsafe (requiring
  88. escaping). A full guide to this feature is in the documentation for the
  89. :ttag:`autoescape` tag.
  90. ``django.contrib.gis`` (GeoDjango)
  91. ----------------------------------
  92. A project over a year in the making, this adds world-class GIS (`Geographic
  93. Information Systems`_) support to Django, in the form of a ``contrib``
  94. application. Its documentation is currently being maintained externally, and
  95. will be merged into the main Django documentation shortly. Huge thanks go to
  96. Justin Bronn, Jeremy Dunck, Brett Hoerner and Travis Pinney for their efforts in
  97. creating and completing this feature.
  98. See http://geodjango.org/ for details.
  99. .. _Geographic Information Systems: https://en.wikipedia.org/wiki/Geographic_information_system
  100. Pluggable file storage
  101. ----------------------
  102. Django's built-in ``FileField`` and ``ImageField`` now can take advantage of
  103. pluggable file-storage backends, allowing extensive customization of where and
  104. how uploaded files get stored by Django. For details, see :doc:`the files
  105. documentation </topics/files>`; big thanks go to Marty Alchin for putting in the
  106. hard work to get this completed.
  107. Jython compatibility
  108. --------------------
  109. Thanks to a lot of work from Leo Soto during a Google Summer of Code project,
  110. Django's codebase has been refactored to remove incompatibilities with
  111. `Jython`_, an implementation of Python written in Java, which runs Python code
  112. on the Java Virtual Machine. Django is now compatible with the forthcoming
  113. Jython 2.5 release.
  114. .. _Jython: https://www.jython.org/
  115. Generic relations in forms and admin
  116. ------------------------------------
  117. Classes are now included in ``django.contrib.contenttypes`` which can be used to
  118. support generic relations in both the admin interface and in end-user forms. See
  119. :ref:`the documentation for generic relations <generic-relations>` for details.
  120. ``INSERT``/``UPDATE`` distinction
  121. ---------------------------------
  122. Although Django's default behavior of having a model's ``save()`` method
  123. automatically determine whether to perform an ``INSERT`` or an ``UPDATE`` at the
  124. SQL level is suitable for the majority of cases, there are occasional situations
  125. where forcing one or the other is useful. As a result, models can now support an
  126. additional parameter to ``save()`` which can force a specific operation.
  127. See :ref:`ref-models-force-insert` for details.
  128. Split ``CacheMiddleware``
  129. -------------------------
  130. Django's ``CacheMiddleware`` has been split into three classes:
  131. ``CacheMiddleware`` itself still exists and retains all of its previous
  132. functionality, but it is now built from two separate middleware classes which
  133. handle the two parts of caching (inserting into and reading from the cache)
  134. separately, offering additional flexibility for situations where combining these
  135. functions into a single middleware posed problems.
  136. Full details, including updated notes on appropriate use, are in :doc:`the
  137. caching documentation </topics/cache>`.
  138. Refactored ``django.contrib.comments``
  139. --------------------------------------
  140. As part of a Google Summer of Code project, Thejaswi Puthraya carried out a
  141. major rewrite and refactoring of Django's bundled comment system, greatly
  142. increasing its flexibility and customizability.
  143. Removal of deprecated features
  144. ------------------------------
  145. A number of features and methods which had previously been marked as deprecated,
  146. and which were scheduled for removal prior to the 1.0 release, are no longer
  147. present in Django. These include imports of the form library from
  148. ``django.newforms`` (now located simply at ``django.forms``), the
  149. ``form_for_model`` and ``form_for_instance`` helper functions (which have been
  150. replaced by ``ModelForm``) and a number of deprecated features which were
  151. replaced by the dispatcher, file-uploading and file-storage refactorings
  152. introduced in the Django 1.0 alpha releases.
  153. Known issues
  154. ============
  155. We've done our best to make Django 1.0 as solid as possible, but unfortunately
  156. there are a couple of issues that we know about in the release.
  157. Multi-table model inheritance with ``to_field``
  158. -----------------------------------------------
  159. If you're using :ref:`multiple table model inheritance
  160. <multi-table-inheritance>`, be aware of this caveat: child models using a custom
  161. ``parent_link`` and ``to_field`` will cause database integrity errors. A set of
  162. models like the following are **not valid**::
  163. class Parent(models.Model):
  164. name = models.CharField(max_length=10)
  165. other_value = models.IntegerField(unique=True)
  166. class Child(Parent):
  167. father = models.OneToOneField(Parent, primary_key=True, to_field="other_value", parent_link=True)
  168. value = models.IntegerField()
  169. This bug will be fixed in the next release of Django.
  170. Caveats with support of certain databases
  171. -----------------------------------------
  172. Django attempts to support as many features as possible on all database
  173. backends. However, not all database backends are alike, and in particular many of the supported database differ greatly from version to version. It's a good idea to checkout our :doc:`notes on supported database </ref/databases>`:
  174. - :ref:`mysql-notes`
  175. - :ref:`sqlite-notes`
  176. - :ref:`oracle-notes`