diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2011-06-09 20:01:28 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2011-06-09 20:01:28 +0000 |
| commit | dff31de20aac85e4f4834c2466762cbf23fc0a7b (patch) | |
| tree | 6d7d6756f53eb599b81827bf097f24cfb1ed7b54 /docs | |
| parent | da0c7cd7778ee99a31587276faee30e94a8255ae (diff) | |
Fixed #16155 -- Removed Python 2.4 compatibility constructs from code and mentions from docs. Thanks Aymeric Augustin for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/faq/install.txt | 16 | ||||
| -rw-r--r-- | docs/internals/contributing/writing-code/branch-policy.txt | 11 | ||||
| -rw-r--r-- | docs/intro/install.txt | 12 | ||||
| -rw-r--r-- | docs/ref/contrib/gis/install.txt | 25 | ||||
| -rw-r--r-- | docs/releases/1.4.txt | 20 | ||||
| -rw-r--r-- | docs/topics/db/transactions.txt | 8 | ||||
| -rw-r--r-- | docs/topics/install.txt | 7 | ||||
| -rw-r--r-- | docs/topics/logging.txt | 8 | ||||
| -rw-r--r-- | docs/topics/testing.txt | 2 |
9 files changed, 45 insertions, 64 deletions
diff --git a/docs/faq/install.txt b/docs/faq/install.txt index f500e77a88..f1e865a966 100644 --- a/docs/faq/install.txt +++ b/docs/faq/install.txt @@ -16,7 +16,7 @@ How do I get started? What are Django's prerequisites? -------------------------------- -Django requires Python_, specifically any version of Python from 2.4 +Django requires Python_, specifically any version of Python from 2.5 through 2.7. No other Python libraries are required for basic Django usage. @@ -40,17 +40,15 @@ PostgreSQL fans, and MySQL_, `SQLite 3`_, and Oracle_ are also supported. .. _`SQLite 3`: http://www.sqlite.org/ .. _Oracle: http://www.oracle.com/ -Do I lose anything by using Python 2.4 versus newer Python versions, such as Python 2.5 or 2.6? +Do I lose anything by using Python 2.5 versus newer Python versions, such as Python 2.6 or 2.7? ----------------------------------------------------------------------------------------------- Not in the core framework. Currently, Django itself officially supports any -version of Python from 2.4 through 2.7, inclusive. However, newer versions of +version of Python from 2.5 through 2.7, inclusive. However, newer versions of Python are often faster, have more features, and are better supported. If you use a newer version of Python you will also have access to some APIs that -aren't available under older versions of Python. For example Django provides -some `context managers`_ for various operations. If you use Python 2.4 you -won't be able to use them, however other APIs which provide the same -functionality are always made available. +aren't available under older versions of Python. For example, since Python 2.6, +you can use the advanced string formatting described in `PEP 3101`_. Third-party applications for use with Django are, of course, free to set their own version requirements. @@ -61,11 +59,11 @@ versions as part of a migration which will end with Django running on Python 3 All else being equal, we recommend that you use the latest 2.x release (currently Python 2.7). This will let you take advantage of the numerous -improvements and optimizations to the Python language since version 2.4, and +improvements and optimizations to the Python language since version 2.5, and will help ease the process of dropping support for older Python versions on the road to Python 3. -.. _context managers: http://docs.python.org/reference/datamodel.html#context-managers +.. _PEP 3101: http://www.python.org/dev/peps/pep-3101/ Can I use Django with Python 2.4? --------------------------------- diff --git a/docs/internals/contributing/writing-code/branch-policy.txt b/docs/internals/contributing/writing-code/branch-policy.txt index 08dfe8bc76..940b96f7ac 100644 --- a/docs/internals/contributing/writing-code/branch-policy.txt +++ b/docs/internals/contributing/writing-code/branch-policy.txt @@ -135,8 +135,8 @@ Pointing Python at the new Django version Once you've retrieved the branch's code, you'll need to change your Python ``site-packages`` directory so that it points to the branch version of the ``django`` directory. (The ``site-packages`` directory is somewhere such as -``/usr/lib/python2.4/site-packages`` or -``/usr/local/lib/python2.4/site-packages`` or ``C:\Python\site-packages``.) +``/usr/lib/python2.7/site-packages`` or +``/usr/local/lib/python2.7/site-packages`` or ``C:\Python\site-packages``.) The simplest way to do this is by renaming the old ``django`` directory to ``django.OLD`` and moving the trunk version of the code into the directory @@ -169,12 +169,5 @@ sure all other lines are commented:: # On windows a path may look like this: # C:/path/to/<branch> -If you're using Django 0.95 or earlier and installed it using -``python setup.py install``, you'll have a directory called something like -``Django-0.95-py2.4.egg`` instead of ``django``. In this case, edit the file -``setuptools.pth`` and remove the line that references the Django ``.egg`` -file. Then copy the branch's version of the ``django`` directory into -``site-packages``. - .. _path file: http://docs.python.org/library/site.html .. _django-developers: http://groups.google.com/group/django-developers diff --git a/docs/intro/install.txt b/docs/intro/install.txt index 0b4cf87938..6bf5b705fb 100644 --- a/docs/intro/install.txt +++ b/docs/intro/install.txt @@ -10,13 +10,11 @@ Install Python -------------- Being a Python Web framework, Django requires Python. It works with any Python -version from 2.4 to 2.7 (due to backwards -incompatibilities in Python 3.0, Django does not currently work with -Python 3.0; see :doc:`the Django FAQ </faq/install>` for more -information on supported Python versions and the 3.0 transition), but we -recommend installing Python 2.5 or later. If you do so, you won't need to set -up a database just yet: Python 2.5 or later includes a lightweight database -called SQLite_. +version from 2.5 to 2.7 (due to backwards incompatibilities in Python 3.0, +Django does not currently work with Python 3.0; see :doc:`the Django FAQ +</faq/install>` for more information on supported Python versions and the 3.0 +transition), these versions of Python include a lightweight database called +SQLite_ so you won't need to set up a database just yet. .. _sqlite: http://sqlite.org/ diff --git a/docs/ref/contrib/gis/install.txt b/docs/ref/contrib/gis/install.txt index 82df82793c..40418568c6 100644 --- a/docs/ref/contrib/gis/install.txt +++ b/docs/ref/contrib/gis/install.txt @@ -8,7 +8,7 @@ Overview ======== In general, GeoDjango installation requires: -1. :ref:`python24` and :ref:`django` +1. Python and :ref:`django` 2. :ref:`spatial_database` 3. :ref:`geospatial_libs` @@ -32,22 +32,10 @@ instructions are available for: Requirements ============ -.. _python24: - -Python 2.4+ ------------ - -Python 2.4 is the minimum version supported by Django, however Python 2.5+ is -recommended because the `ctypes`__ module comes included; otherwise, 2.4 users -will need to `download and install ctypes`__. - -__ http://docs.python.org/lib/module-ctypes.html -__ http://sourceforge.net/projects/ctypes/files/ - .. _django: -Django ------- +Python and Django +----------------- Because GeoDjango is included with Django, please refer to Django's :doc:`installation instructions </intro/install>` for details on how to install. @@ -1034,7 +1022,6 @@ Required package information: * ``flex``: required to build PostGIS * ``postgresql-8.1`` * ``postgresql-server-dev-8.1``: for ``pg_config`` -* ``python-ctypes``: Python 2.4 needs to have ctypes installed separately * ``python-psycopg2`` * ``python-setuptools``: for ``easy_install`` @@ -1110,7 +1097,7 @@ Python ^^^^^^ First, download the latest `Python 2.7 installer`__ from the Python Web site. -Next, run the installer and keep the defaults -- for example, keep +Next, run the installer and keep the defaults -- for example, keep 'Install for all users' checked and the installation path set as ``C:\Python27``. @@ -1165,7 +1152,7 @@ tree and select :menuselection:`PostGIS 1.5 for PostgreSQL 9.0`. After clicking next, you will be prompted to select your mirror, PostGIS will be downloaded, and the PostGIS installer will begin. Select only the -default options during install (e.g., do not uncheck the option to create a +default options during install (e.g., do not uncheck the option to create a default PostGIS database). .. note:: @@ -1216,7 +1203,7 @@ executable with ``cmd.exe``, will set this up:: reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROJ_LIB /t REG_EXPAND_SZ /f /d "%PROJ_LIB%" For your convenience, these commands are available in the execuatble batch -script, :download:`geodjango_setup.bat`. +script, :download:`geodjango_setup.bat`. .. note:: diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt index db62bedf25..90f925c02e 100644 --- a/docs/releases/1.4.txt +++ b/docs/releases/1.4.txt @@ -17,6 +17,26 @@ we've `begun the deprecation process for some features`_. .. _backwards incompatible changes: backwards-incompatible-changes-1.4_ .. _begun the deprecation process for some features: deprecated-features-1.4_ +Python compatibility +==================== + +While not a new feature, it's important to note that Django 1.4 introduces the +second shift in our Python compatibility policy since Django's initial public +debut. Django 1.2 dropped support for Python 2.3; now Django 1.4 drops support +for Python 2.4. As such, the minimum Python version required for Django is now +2.5, and Django is tested and supported on Python 2.5, 2.6 and 2.7. + +This change should affect only a small number of Django users, as most +operating-system vendors today are shipping Python 2.5 or newer as their default +version. If you're still using Python 2.4, however, you'll need to stick to +Django 1.3 until you can upgrade; per :doc:`our support policy +</internals/release-process>`, Django 1.3 will continue to receive security +support until the release of Django 1.5. + +Django does not support Python 3.x at this time. A document outlining our full +timeline for deprecating Python 2.x and moving to Python 3.x will be published +before the release of Django 1.4. + What's new in Django 1.4 ======================== diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt index b2539d8f06..c316bbf143 100644 --- a/docs/topics/db/transactions.txt +++ b/docs/topics/db/transactions.txt @@ -79,9 +79,6 @@ These functions, described in detail below, can be used in two different ways: # this code executes inside a transaction # ... - This technique works with all supported version of Python (that is, with - Python 2.4 and greater). - * As a `context manager`_ around a particular block of code:: from django.db import transaction @@ -96,8 +93,9 @@ These functions, described in detail below, can be used in two different ways: # this code executes inside a transaction # ... - The ``with`` statement is new in Python 2.5, and so this syntax can only - be used with Python 2.5 and above. +Both techniques work with all supported version of Python. However, in Python +2.5, you must add ``from __future__ import with_statement`` at the beginning +of your module if you are using the ``with`` statement. .. _decorator: http://docs.python.org/glossary.html#term-decorator .. _context manager: http://docs.python.org/glossary.html#term-context-manager diff --git a/docs/topics/install.txt b/docs/topics/install.txt index ffa445f358..46d6615a82 100644 --- a/docs/topics/install.txt +++ b/docs/topics/install.txt @@ -9,7 +9,7 @@ Install Python Being a Python Web framework, Django requires Python. -It works with any Python version from 2.4 to 2.7 (due to backwards +It works with any Python version from 2.5 to 2.7 (due to backwards incompatibilities in Python 3.0, Django does not currently work with Python 3.0; see :doc:`the Django FAQ </faq/install>` for more information on supported Python versions and the 3.0 transition). @@ -102,11 +102,6 @@ database bindings are installed. will also want to read the database-specific :ref:`notes for the MySQL backend <mysql-notes>`. -* If you're using SQLite and Python 2.4, you'll need pysqlite_. Use version - 2.0.3 or higher. Python 2.5 ships with an SQLite wrapper in the standard - library, so you don't need to install anything extra in that case. Please - read the :ref:`SQLite backend notes <sqlite-notes>`. - * If you're using Oracle, you'll need a copy of cx_Oracle_, but please read the database-specific :ref:`notes for the Oracle backend <oracle-notes>` for important information regarding supported versions of both Oracle and diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt index e2c9f72ea6..06050af899 100644 --- a/docs/topics/logging.txt +++ b/docs/topics/logging.txt @@ -441,10 +441,6 @@ Messages to this logger have the following extra context: * ``request``: The request object that generated the logging message. -.. note:: - Due to a limitation in the logging library, this extra - context is not available if you are using Python 2.4. - ``django.db.backends`` ~~~~~~~~~~~~~~~~~~~~~~ @@ -462,10 +458,6 @@ For performance reasons, SQL logging is only enabled when ``settings.DEBUG`` is set to ``True``, regardless of the logging level or handlers that are installed. -.. note:: - Due to a limitation in the logging library, this extra - context is not available if you are using Python 2.4. - Handlers -------- diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index 3f25dfff9f..a21ad6a77e 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -79,7 +79,7 @@ module defines tests in class-based approach. adding some extremely useful features. To ensure that every Django project can benefit from these new features, Django ships with a copy of unittest2_, a copy of the Python 2.7 unittest library, - backported for Python 2.4 compatibility. + backported for Python 2.5 compatibility. To access this library, Django provides the ``django.utils.unittest`` module alias. If you are using Python |
