Ticket #16155: drop-support-for-python24.patch
File drop-support-for-python24.patch, 20.2 KB (added by , 13 years ago) |
---|
-
docs/intro/install.txt
10 10 -------------- 11 11 12 12 Being a Python Web framework, Django requires Python. It works with any Python 13 version from 2.4 to 2.7 (due to backwards 14 incompatibilities in Python 3.0, Django does not currently work with 15 Python 3.0; see :doc:`the Django FAQ </faq/install>` for more 16 information on supported Python versions and the 3.0 transition), but we 17 recommend installing Python 2.5 or later. If you do so, you won't need to set 18 up a database just yet: Python 2.5 or later includes a lightweight database 19 called SQLite_. 13 version from 2.5 to 2.7 (due to backwards incompatibilities in Python 3.0, 14 Django does not currently work with Python 3.0; see :doc:`the Django FAQ 15 </faq/install>` for more information on supported Python versions and the 3.0 16 transition), but we recommend installing Python 2.5 or later. If you do so, you 17 won't need to set up a database just yet: Python 2.5 or later includes a 18 lightweight database called SQLite_. 20 19 21 20 .. _sqlite: http://sqlite.org/ 22 21 -
docs/internals/contributing/writing-code/branch-policy.txt
135 135 Once you've retrieved the branch's code, you'll need to change your Python 136 136 ``site-packages`` directory so that it points to the branch version of the 137 137 ``django`` directory. (The ``site-packages`` directory is somewhere such as 138 ``/usr/lib/python2. 4/site-packages`` or139 ``/usr/local/lib/python2. 4/site-packages`` or ``C:\Python\site-packages``.)138 ``/usr/lib/python2.7/site-packages`` or 139 ``/usr/local/lib/python2.7/site-packages`` or ``C:\Python\site-packages``.) 140 140 141 141 The simplest way to do this is by renaming the old ``django`` directory to 142 142 ``django.OLD`` and moving the trunk version of the code into the directory … … 169 169 # On windows a path may look like this: 170 170 # C:/path/to/<branch> 171 171 172 If you're using Django 0.95 or earlier and installed it using173 ``python setup.py install``, you'll have a directory called something like174 ``Django-0.95-py2.4.egg`` instead of ``django``. In this case, edit the file175 ``setuptools.pth`` and remove the line that references the Django ``.egg``176 file. Then copy the branch's version of the ``django`` directory into177 ``site-packages``.178 179 172 .. _path file: http://docs.python.org/library/site.html 180 173 .. _django-developers: http://groups.google.com/group/django-developers -
docs/topics/install.txt
9 9 10 10 Being a Python Web framework, Django requires Python. 11 11 12 It works with any Python version from 2. 4to 2.7 (due to backwards12 It works with any Python version from 2.5 to 2.7 (due to backwards 13 13 incompatibilities in Python 3.0, Django does not currently work with 14 14 Python 3.0; see :doc:`the Django FAQ </faq/install>` for more 15 15 information on supported Python versions and the 3.0 transition). … … 102 102 will also want to read the database-specific :ref:`notes for the MySQL 103 103 backend <mysql-notes>`. 104 104 105 * If you're using SQLite and Python 2.4, you'll need pysqlite_. Use version106 2.0.3 or higher. Python 2.5 ships with an SQLite wrapper in the standard107 library, so you don't need to install anything extra in that case. Please108 read the :ref:`SQLite backend notes <sqlite-notes>`.109 110 105 * If you're using Oracle, you'll need a copy of cx_Oracle_, but please 111 106 read the database-specific :ref:`notes for the Oracle backend <oracle-notes>` 112 107 for important information regarding supported versions of both Oracle and -
docs/topics/db/transactions.txt
79 79 # this code executes inside a transaction 80 80 # ... 81 81 82 This technique works with all supported version of Python (that is, with83 Python 2.4 and greater).84 85 82 * As a `context manager`_ around a particular block of code:: 86 83 87 84 from django.db import transaction … … 96 93 # this code executes inside a transaction 97 94 # ... 98 95 99 The ``with`` statement is new in Python 2.5, and so this syntax can only 100 be used with Python 2.5 and above. 96 Both techniques work with all supported version of Python. However, in Python 97 2.5, you must add ``from __future__ import with_statement`` at the beginning 98 of your module if you are using the ``with`` statement. 101 99 102 100 .. _decorator: http://docs.python.org/glossary.html#term-decorator 103 101 .. _context manager: http://docs.python.org/glossary.html#term-context-manager -
docs/topics/testing.txt
79 79 adding some extremely useful features. To ensure that every Django 80 80 project can benefit from these new features, Django ships with a 81 81 copy of unittest2_, a copy of the Python 2.7 unittest library, 82 backported for Python 2. 4compatibility.82 backported for Python 2.5 compatibility. 83 83 84 84 To access this library, Django provides the 85 85 ``django.utils.unittest`` module alias. If you are using Python -
docs/topics/logging.txt
441 441 * ``request``: The request object that generated the logging 442 442 message. 443 443 444 .. note::445 Due to a limitation in the logging library, this extra446 context is not available if you are using Python 2.4.447 448 444 ``django.db.backends`` 449 445 ~~~~~~~~~~~~~~~~~~~~~~ 450 446 … … 462 458 ``settings.DEBUG`` is set to ``True``, regardless of the logging 463 459 level or handlers that are installed. 464 460 465 .. note::466 Due to a limitation in the logging library, this extra467 context is not available if you are using Python 2.4.468 469 461 Handlers 470 462 -------- 471 463 -
docs/releases/1.4.txt
13 13 .. _new features: `What's new in Django 1.4`_ 14 14 .. _backwards incompatible changes: backwards-incompatible-changes-1.4_ 15 15 16 Python compatibility 17 ==================== 18 19 While not a new feature, it's important to note that Django 1.4 introduces the 20 second shift in our Python compatibility policy since Django's initial public 21 debut. Django 1.2 dropped support for Python 2.3; now Django 1.4 drops support 22 for Python 2.4. As such, the minimum Python version required for Django is now 23 2.5, and Django is tested and supported on Python 2.5, 2.6 and 2.7. 24 25 This change should affect only a small number of Django users, as most 26 operating-system vendors today are shipping Python 2.5 or newer as their default 27 version. If you're still using Python 2.4, however, you'll need to stick to 28 Django 1.3 until you can upgrade; per :doc:`our support policy 29 </internals/release-process>`, Django 1.3 will continue to receive security 30 support until the release of Django 1.5. 31 32 Django does not support Python 3.x at this time. A document outlining our full 33 timeline for deprecating Python 2.x and moving to Python 3.x will be published 34 before the release of Django 1.4. 35 16 36 What's new in Django 1.4 17 37 ======================== 18 38 -
docs/faq/install.txt
16 16 What are Django's prerequisites? 17 17 -------------------------------- 18 18 19 Django requires Python_, specifically any version of Python from 2. 419 Django requires Python_, specifically any version of Python from 2.5 20 20 through 2.7. No other Python libraries are required for basic Django 21 21 usage. 22 22 … … 40 40 .. _`SQLite 3`: http://www.sqlite.org/ 41 41 .. _Oracle: http://www.oracle.com/ 42 42 43 Do I lose anything by using Python 2. 4 versus newer Python versions, such as Python 2.5 or 2.6?43 Do I lose anything by using Python 2.5 versus newer Python versions, such as Python 2.6 or 2.7? 44 44 ----------------------------------------------------------------------------------------------- 45 45 46 46 Not in the core framework. Currently, Django itself officially supports any 47 version of Python from 2. 4through 2.7, inclusive. However, newer versions of47 version of Python from 2.5 through 2.7, inclusive. However, newer versions of 48 48 Python are often faster, have more features, and are better supported. If you 49 49 use a newer version of Python you will also have access to some APIs that 50 aren't available under older versions of Python. For example Django provides 51 some `context managers`_ for various operations. If you use Python 2.4 you 52 won't be able to use them, however other APIs which provide the same 53 functionality are always made available. 50 aren't available under older versions of Python. For example, since Python 2.6, 51 you can use the advanced string formatting described in `PEP 3101`_. 54 52 55 53 Third-party applications for use with Django are, of course, free to set their 56 54 own version requirements. … … 61 59 62 60 All else being equal, we recommend that you use the latest 2.x release 63 61 (currently Python 2.7). This will let you take advantage of the numerous 64 improvements and optimizations to the Python language since version 2. 4, and62 improvements and optimizations to the Python language since version 2.5, and 65 63 will help ease the process of dropping support for older Python versions on 66 64 the road to Python 3. 67 65 68 .. _ context managers: http://docs.python.org/reference/datamodel.html#context-managers66 .. _PEP 3101: http://www.python.org/dev/peps/pep-3101/ 69 67 70 68 Can I use Django with Python 2.4? 71 69 --------------------------------- -
docs/ref/contrib/gis/install.txt
8 8 ======== 9 9 In general, GeoDjango installation requires: 10 10 11 1. :ref:`python2 4` and :ref:`django`11 1. :ref:`python25` and :ref:`django` 12 12 2. :ref:`spatial_database` 13 13 3. :ref:`geospatial_libs` 14 14 … … 32 32 Requirements 33 33 ============ 34 34 35 .. _python24: 36 37 Python 2.4+ 38 ----------- 39 40 Python 2.4 is the minimum version supported by Django, however Python 2.5+ is 41 recommended because the `ctypes`__ module comes included; otherwise, 2.4 users 42 will need to `download and install ctypes`__. 43 44 __ http://docs.python.org/lib/module-ctypes.html 45 __ http://sourceforge.net/projects/ctypes/files/ 46 35 .. _python25: 47 36 .. _django: 48 37 49 Django50 ------ 38 Python and Django 39 ----------------- 51 40 52 41 Because GeoDjango is included with Django, please refer to Django's 53 42 :doc:`installation instructions </intro/install>` for details on how to install. … … 1034 1023 * ``flex``: required to build PostGIS 1035 1024 * ``postgresql-8.1`` 1036 1025 * ``postgresql-server-dev-8.1``: for ``pg_config`` 1037 * ``python-ctypes``: Python 2.4 needs to have ctypes installed separately1038 1026 * ``python-psycopg2`` 1039 1027 * ``python-setuptools``: for ``easy_install`` 1040 1028 -
django/http/__init__.py
17 17 # Python 2.6 and greater 18 18 from urlparse import parse_qsl 19 19 except ImportError: 20 # Python 2.5, 2.4. Works on Python 2.6 but raises 21 # PendingDeprecationWarning 20 # Python 2.5. Works on Python 2.6 but raises PendingDeprecationWarning 22 21 from cgi import parse_qsl 23 22 24 23 import Cookie 25 24 # httponly support exists in Python 2.6's Cookie library, 26 # but not in Python 2. 4 or 2.5.25 # but not in Python 2.5. 27 26 _morsel_supports_httponly = Cookie.Morsel._reserved.has_key('httponly') 28 27 # Some versions of Python 2.7 and later won't need this encoding bug fix: 29 28 _cookie_encodes_correctly = Cookie.SimpleCookie().value_encode(';') == (';', '"\\073"') -
django/db/models/base.py
914 914 return cls.__new__(cls) 915 915 model_unpickle.__safe_for_unpickle__ = True 916 916 917 if sys.version_info < (2, 5): 918 # Prior to Python 2.5, Exception was an old-style class 919 def subclass_exception(name, parents, unused): 920 return types.ClassType(name, parents, {}) 921 else: 922 def subclass_exception(name, parents, module): 923 return type(name, parents, {'__module__': module}) 917 def subclass_exception(name, parents, module): 918 return type(name, parents, {'__module__': module}) -
django/db/backends/oracle/base.py
176 176 # classes to normalize values from the database (the to_python 177 177 # method is used for validation and isn't what we want here). 178 178 elif isinstance(value, Database.Timestamp): 179 # In Python 2.3, the cx_Oracle driver returns its own180 # Timestamp object that we must convert to a datetime class.181 if not isinstance(value, datetime.datetime):182 value = datetime.datetime(value.year, value.month,183 value.day, value.hour, value.minute, value.second,184 value.fsecond)185 179 if field and field.get_internal_type() == 'DateTimeField': 186 180 pass 187 181 elif field and field.get_internal_type() == 'DateField': -
django/core/cache/__init__.py
29 29 # Python 2.6 and greater 30 30 from urlparse import parse_qsl 31 31 except ImportError: 32 # Python 2.5, 2.4. Works on Python 2.6 but raises 33 # PendingDeprecationWarning 32 # Python 2.5. Works on Python 2.6 but raises PendingDeprecationWarning 34 33 from cgi import parse_qsl 35 34 36 35 __all__ = [ -
django/utils/translation/trans_real.py
63 63 class DjangoTranslation(gettext_module.GNUTranslations): 64 64 """ 65 65 This class sets up the GNUTranslations context with regard to output 66 charset. Django uses a defined DEFAULT_CHARSET as the output charset on 67 Python 2.4. 66 charset. 68 67 """ 69 68 def __init__(self, *args, **kw): 70 69 gettext_module.GNUTranslations.__init__(self, *args, **kw) -
django/utils/http.py
198 198 p1, p2 = urlparse.urlparse(url1), urlparse.urlparse(url2) 199 199 return (p1.scheme, p1.hostname, p1.port) == (p2.scheme, p2.hostname, p2.port) 200 200 else: 201 # Python 2. 4, 2.5 compatibility. This actually works for Python 2.6 and202 # above,but the above definition is much more obviously correct and so is201 # Python 2.5 compatibility. This actually works for Python 2.6 and above, 202 # but the above definition is much more obviously correct and so is 203 203 # preferred going forward. 204 204 def same_origin(url1, url2): 205 205 """ -
django/utils/itercompat.py
7 7 import itertools 8 8 import warnings 9 9 10 # Fallback for Python 2. 4, Python 2.510 # Fallback for Python 2.5 11 11 def product(*args, **kwds): 12 12 """ 13 13 Taken from http://docs.python.org/library/itertools.html#itertools.product -
django/utils/hashcompat.py
3 3 hashlib module containing both hash algorithms. Here, we provide a common 4 4 interface to the md5 and sha constructors, depending on system version. 5 5 """ 6 import sys7 import warnings8 6 7 import warnings 9 8 warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead", 10 PendingDeprecationWarning)9 DeprecationWarning) 11 10 12 if sys.version_info >= (2, 5): 13 import hashlib 14 md5_constructor = hashlib.md5 15 md5_hmac = md5_constructor 16 sha_constructor = hashlib.sha1 17 sha_hmac = sha_constructor 18 else: 19 import md5 20 md5_constructor = md5.new 21 md5_hmac = md5 22 import sha 23 sha_constructor = sha.new 24 sha_hmac = sha 11 import hashlib 12 md5_constructor = hashlib.md5 13 md5_hmac = md5_constructor 14 sha_constructor = hashlib.sha1 15 sha_hmac = sha_constructor -
tests/regressiontests/admin_scripts/tests.py
1126 1126 "--help is handled as a special case" 1127 1127 args = ['--help'] 1128 1128 out, err = self.run_manage(args) 1129 if sys.version_info < (2, 5): 1130 self.assertOutput(out, "usage: manage.py subcommand [options] [args]") 1131 else: 1132 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1129 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1133 1130 self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.") 1134 1131 1135 1132 def test_short_help(self): 1136 1133 "-h is handled as a short form of --help" 1137 1134 args = ['-h'] 1138 1135 out, err = self.run_manage(args) 1139 if sys.version_info < (2, 5): 1140 self.assertOutput(out, "usage: manage.py subcommand [options] [args]") 1141 else: 1142 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1136 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1143 1137 self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.") 1144 1138 1145 1139 def test_specific_help(self): -
tests/regressiontests/httpwrappers/tests.py
248 248 """ 249 249 Test that we don't output tricky characters in encoded value 250 250 """ 251 # Python 2.4 compatibility note: Python 2.4's cookie implementation252 # always returns Set-Cookie headers terminating in semi-colons.253 # That's not the bug this test is looking for, so ignore it.254 251 c = SimpleCookie() 255 252 c['test'] = "An,awkward;value" 256 253 self.assertTrue(";" not in c.output().rstrip(';')) # IE compat -
INSTALL
1 1 Thanks for downloading Django. 2 2 3 To install it, make sure you have Python 2. 4or greater installed. Then run3 To install it, make sure you have Python 2.5 or greater installed. Then run 4 4 this command from the command prompt: 5 5 6 6 python setup.py install … … 9 9 site-packages directory, which is located wherever your Python installation 10 10 lives. Some places you might check are: 11 11 12 /usr/lib/python2.7/site-packages (Unix, Python 2.7) 13 /usr/lib/python2.6/site-packages (Unix, Python 2.6) 12 14 /usr/lib/python2.5/site-packages (Unix, Python 2.5) 13 /usr/lib/python2.4/site-packages (Unix, Python 2.4)14 15 C:\\PYTHON\site-packages (Windows) 15 16 16 17 For more detailed instructions, see docs/intro/install.txt.