2010-11-13 19:42:11 +01:00
|
|
|
================================
|
2010-12-19 16:02:13 +01:00
|
|
|
Django 1.3 beta 1 release notes
|
2010-11-13 19:42:11 +01:00
|
|
|
================================
|
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
Welcome to Django 1.3 beta 1!
|
2010-11-13 19:42:11 +01:00
|
|
|
|
|
|
|
This is the second in a series of preview/development releases leading
|
|
|
|
up to the eventual release of Django 1.3. This release is primarily
|
|
|
|
targeted at developers who are interested in trying out new features
|
|
|
|
and testing the Django codebase to help identify and resolve bugs
|
|
|
|
prior to the final 1.3 release.
|
|
|
|
|
|
|
|
As such, this release is *not* intended for production use, and any such use
|
|
|
|
is discouraged.
|
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
What's new in Django 1.3 beta 1
|
|
|
|
===============================
|
2010-11-13 19:42:11 +01:00
|
|
|
|
|
|
|
Further tweaks to the staticfiles app
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2010-11-22 07:08:38 +01:00
|
|
|
Django 1.3 ships with a new contrib app :mod:`django.contrib.staticfiles`
|
|
|
|
to help developers handle the static media files (images, CSS, JavaScript,
|
2010-11-13 19:42:11 +01:00
|
|
|
etc.) that are needed to render a complete web page.
|
|
|
|
|
2010-11-22 07:08:38 +01:00
|
|
|
The :mod:`~django.contrib.staticfiles` app ships with the ability to
|
|
|
|
automatically serve static files during development (if the :setting:`DEBUG`
|
|
|
|
setting is ``True``) when using the :djadmin:`runserver` management command.
|
|
|
|
Based on feedback from the community this release adds two new options to the
|
2011-05-13 06:33:42 +02:00
|
|
|
:djadmin:`runserver` command to modify this behavior:
|
2010-11-13 19:42:11 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* ``--nostatic``: prevents the :djadmin:`runserver` command from serving
|
|
|
|
files completely.
|
2010-11-13 19:42:11 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* ``--insecure``: enables serving of static files even if running with
|
|
|
|
:setting:`DEBUG` set to False. (This is **not** recommended!)
|
2010-11-13 19:42:11 +01:00
|
|
|
|
2010-11-22 07:08:38 +01:00
|
|
|
See the :doc:`staticfiles reference documentation </ref/contrib/staticfiles>`
|
|
|
|
for more details, or learn :doc:`how to manage static files
|
2013-03-07 20:15:39 +01:00
|
|
|
</howto/static-files/index>`.
|
2010-11-13 19:42:11 +01:00
|
|
|
|
2010-11-17 16:37:33 +01:00
|
|
|
Translation comments
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
If you would like to give translators hints about a translatable string, you
|
|
|
|
can add a comment prefixed with the ``Translators`` keyword on the line
|
|
|
|
preceding the string, e.g.::
|
|
|
|
|
|
|
|
def my_view(request):
|
|
|
|
# Translators: This message appears on the home page only
|
|
|
|
output = ugettext("Welcome to my site.")
|
|
|
|
|
|
|
|
The comment will appear in the resulting .po file and should also be
|
|
|
|
displayed by most translation tools.
|
|
|
|
|
|
|
|
For more information, see :ref:`translator-comments`.
|
|
|
|
|
2010-12-21 20:18:12 +01:00
|
|
|
Permissions for inactive users
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
If you provide a custom auth backend with ``supports_inactive_user`` set to
|
|
|
|
``True``, an inactive user model will check the backend for permissions.
|
|
|
|
This is useful for further centralizing the permission handling. See the
|
2012-12-28 20:00:11 +01:00
|
|
|
:doc:`authentication docs </topics/auth/index>` for more details.
|
2010-12-21 20:18:12 +01:00
|
|
|
|
2010-11-17 16:36:26 +01:00
|
|
|
Backwards-incompatible changes in 1.3 alpha 2
|
|
|
|
=============================================
|
|
|
|
|
2010-12-23 05:03:28 +01:00
|
|
|
Change to admin lookup filters
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The Django admin has long had an undocumented "feature" allowing savvy
|
|
|
|
users to manipulate the query string of changelist pages to filter the
|
|
|
|
list of objects displayed. However, this also creates a security
|
|
|
|
issue, as a staff user with sufficient knowledge of model structure
|
2013-11-30 14:37:15 +01:00
|
|
|
could use this "feature" to gain access to information not normally accessible.
|
2010-12-23 05:03:28 +01:00
|
|
|
|
|
|
|
As a result, changelist filtering now explicitly validates all lookup
|
|
|
|
arguments in the query string, and permits only fields which are
|
|
|
|
directly on the model, or relations explicitly permitted by the
|
|
|
|
``ModelAdmin`` definition. If you were relying on this undocumented
|
|
|
|
feature, you will need to update your ``ModelAdmin`` definitions to
|
|
|
|
whitelist the relations you choose to expose for filtering.
|
|
|
|
|
2010-11-17 16:36:26 +01:00
|
|
|
Introduction of STATIC_URL and STATIC_ROOT settings
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2010-11-22 07:08:38 +01:00
|
|
|
The newly introduced :mod:`~django.contrib.staticfiles` app -- which extends
|
|
|
|
Django's abilities to handle static files for apps and projects -- required the
|
|
|
|
additon of two new settings to refer to those files in templates and code,
|
|
|
|
especially in contrast to the :setting:`MEDIA_URL` and :setting:`MEDIA_ROOT`
|
|
|
|
settings that refer to user-uploaded files.
|
2010-11-17 16:36:26 +01:00
|
|
|
|
|
|
|
Prior to 1.3 alpha 2 these settings were called ``STATICFILES_URL`` and
|
2010-11-22 07:08:38 +01:00
|
|
|
``STATICFILES_ROOT`` to follow the naming scheme for app-centric settings.
|
2010-11-17 16:36:26 +01:00
|
|
|
Based on feedback from the community it became apparent that those settings
|
2010-11-22 07:08:38 +01:00
|
|
|
created confusion, especially given the fact that handling static files is also
|
|
|
|
desired outside the use of the optional :mod:`~django.contrib.staticfiles` app.
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2010-11-22 07:08:38 +01:00
|
|
|
As a result, we took the following steps to rectify the issue:
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* Two new global settings were added that will be used by, **but are not
|
2011-10-14 02:16:14 +02:00
|
|
|
limited to**, the :doc:`staticfiles</ref/contrib/staticfiles>` app:
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* :setting:`STATIC_ROOT` (formally ``STATICFILES_ROOT``)
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* :setting:`STATIC_URL` (formally ``STATICFILES_URL``)
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* The ``django.contrib.staticfiles.templatetags.staticfiles.get_staticfiles_prefix``
|
2011-10-14 02:16:14 +02:00
|
|
|
template tag was moved to Django's core (``django.templatetags.static``) and
|
|
|
|
renamed to :ttag:`get_static_prefix`.
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* The ``django.contrib.staticfiles.context_processors.staticfiles``
|
2011-10-14 02:16:14 +02:00
|
|
|
context processor was moved to Django's core
|
|
|
|
(``django.core.context_processors.static``) and renamed to
|
|
|
|
:func:`~django.core.context_processors.static`.
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2013-06-20 08:51:20 +02:00
|
|
|
* :ref:`form-asset-paths` now uses :setting:`STATIC_URL` as the prefix
|
2011-10-14 02:16:14 +02:00
|
|
|
**if the value is not None**, and falls back to the previously used
|
|
|
|
:setting:`MEDIA_URL` setting otherwise.
|
2010-11-17 16:36:26 +01:00
|
|
|
|
2010-12-02 01:44:35 +01:00
|
|
|
Changes to the login methods of the admin
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
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 r12634_ to support a broader set of characters for usernames.
|
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
This release refactors the admin's login mechanism to use a subclass of the
|
2010-12-02 01:44:35 +01:00
|
|
|
:class:`~django.contrib.auth.forms.AuthenticationForm` instead of a manual
|
|
|
|
form validation. The previously undocumented method
|
|
|
|
``'django.contrib.admin.sites.AdminSite.display_login_form'`` has been removed
|
|
|
|
in favor of a new :attr:`~django.contrib.admin.AdminSite.login_form`
|
|
|
|
attribute.
|
|
|
|
|
2012-03-13 18:53:31 +01:00
|
|
|
.. _r12634: https://code.djangoproject.com/changeset/12634
|
2010-12-02 01:44:35 +01:00
|
|
|
|
2010-12-23 03:56:31 +01:00
|
|
|
Changes to ``USStateField``
|
|
|
|
===========================
|
|
|
|
|
2013-01-01 14:12:42 +01:00
|
|
|
The ``django.contrib.localflavor`` application contains collections
|
2010-12-23 03:56:31 +01:00
|
|
|
of code relevant to specific countries or cultures. One such is
|
2012-12-29 16:35:12 +01:00
|
|
|
``USStateField``, which provides a field for storing the two-letter postal
|
|
|
|
abbreviation of a U.S. state. This field has consistently caused problems,
|
|
|
|
however, because it is often used to store the state portion of a U.S postal
|
2010-12-23 03:56:31 +01:00
|
|
|
address, but not all "states" recognized by the U.S Postal Service are
|
|
|
|
actually states of the U.S. or even U.S. territory. Several
|
|
|
|
compromises over the list of choices resulted in some users feeling
|
|
|
|
the field supported too many locations, while others felt it supported
|
|
|
|
too few.
|
|
|
|
|
|
|
|
In Django 1.3 we're taking a new approach to this problem, implemented
|
|
|
|
as a pair of changes:
|
|
|
|
|
2013-03-22 10:50:45 +01:00
|
|
|
* The choice list for ``USStateField`` has changed. Previously, it
|
2010-12-23 03:56:31 +01:00
|
|
|
consisted of the 50 U.S. states, the District of Columbia and
|
|
|
|
U.S. overseas territories. As of Django 1.3 it includes all previous
|
|
|
|
choices, plus the U.S. Armed Forces postal codes.
|
|
|
|
|
|
|
|
* A new model field,
|
2012-12-29 16:35:12 +01:00
|
|
|
``django.contrib.localflavor.us.models.USPostalCodeField``, has
|
2010-12-23 03:56:31 +01:00
|
|
|
been added which draws its choices from a list of all postal
|
|
|
|
abbreviations recognized by the U.S Postal Service. This includes
|
2013-03-22 10:50:45 +01:00
|
|
|
all abbreviations recognized by ``USStateField``, plus three
|
2010-12-23 03:56:31 +01:00
|
|
|
independent nations -- the Federated States of Micronesia, the
|
|
|
|
Republic of the Marshall Islands and the Republic of Palau -- which
|
|
|
|
are serviced under treaty by the U.S. postal system. A new form
|
2013-01-01 14:12:42 +01:00
|
|
|
widget, ``django.contrib.localflavor.us.forms.USPSSelect``, is
|
2010-12-23 03:56:31 +01:00
|
|
|
also available and provides the same set of choices.
|
|
|
|
|
|
|
|
Additionally, several finer-grained choice tuples are provided which
|
|
|
|
allow mixing and matching of subsets of the U.S. states and
|
|
|
|
territories, and other locations serviced by the U.S. postal
|
2013-01-01 14:12:42 +01:00
|
|
|
system. Consult the ``django.contrib.localflavor`` documentation
|
2010-12-23 03:56:31 +01:00
|
|
|
for more details.
|
|
|
|
|
2013-03-22 10:50:45 +01:00
|
|
|
The change to ``USStateField`` is technically backwards-incompatible for
|
2010-12-23 03:56:31 +01:00
|
|
|
users who expect this field to exclude Armed Forces locations. If you
|
|
|
|
need to support U.S. mailing addresses without Armed Forces locations,
|
|
|
|
see the list of choice tuples available in the localflavor
|
|
|
|
documentation.
|
|
|
|
|
2010-11-13 19:42:11 +01:00
|
|
|
The Django 1.3 roadmap
|
|
|
|
======================
|
|
|
|
|
|
|
|
Before the final Django 1.3 release, several other preview/development
|
|
|
|
releases will be made available. The current schedule consists of at
|
|
|
|
least the following:
|
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
* Week of **January 24, 2011**: First Django 1.3 release
|
2010-11-13 19:42:11 +01:00
|
|
|
candidate. String freeze for translations.
|
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
* Week of **January 31, 2011**: Django 1.3 final release.
|
2010-11-13 19:42:11 +01:00
|
|
|
|
2010-12-19 16:02:13 +01:00
|
|
|
If necessary, additional beta or release-candidate packages
|
2010-11-13 19:42:11 +01:00
|
|
|
will be issued prior to the final 1.3 release. Django 1.3 will be
|
|
|
|
released approximately one week after the final release candidate.
|
|
|
|
|
|
|
|
|
|
|
|
What you can do to help
|
|
|
|
=======================
|
|
|
|
|
|
|
|
In order to provide a high-quality 1.3 release, we need your help. Although this
|
2010-12-19 16:02:13 +01:00
|
|
|
beta release is, again, *not* intended for production use, you can help the
|
|
|
|
Django team by trying out the beta codebase in a safe test environment and
|
2010-11-13 19:42:11 +01:00
|
|
|
reporting any bugs or issues you encounter. The Django ticket tracker is the
|
|
|
|
central place to search for open issues:
|
|
|
|
|
2012-03-13 18:53:31 +01:00
|
|
|
* https://code.djangoproject.com/timeline
|
2010-11-13 19:42:11 +01:00
|
|
|
|
|
|
|
Please open new tickets if no existing ticket corresponds to a problem you're
|
|
|
|
running into.
|
|
|
|
|
|
|
|
Additionally, discussion of Django development, including progress toward the
|
|
|
|
1.3 release, takes place daily on the django-developers mailing list:
|
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* http://groups.google.com/group/django-developers
|
2010-11-13 19:42:11 +01:00
|
|
|
|
|
|
|
... and in the ``#django-dev`` IRC channel on ``irc.freenode.net``. If you're
|
|
|
|
interested in helping out with Django's development, feel free to join the
|
|
|
|
discussions there.
|
|
|
|
|
|
|
|
Django's online documentation also includes pointers on how to contribute to
|
|
|
|
Django:
|
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* :doc:`How to contribute to Django </internals/contributing/index>`
|
2010-11-13 19:42:11 +01:00
|
|
|
|
|
|
|
Contributions on any level -- developing code, writing documentation or simply
|
|
|
|
triaging tickets and helping to test proposed bugfixes -- are always welcome and
|
|
|
|
appreciated.
|