Support for Python 2.5 has been deprecated. While Google will support Python 2.5 applications in the App Engine production environment per our terms of service , the ability to create new Python 2.5 applications will be removed in January 2014, and eventually Python 2.5 support will be removed from the production environment. For more information, see our blog post announcing the deprecation and Migrating to Python 2.7 .
This page describes the key differences between Python 2.5 and Python 2.7:
- Multithreading
- Concurrent Requests
- Bytecode Modification
- Bytecode Upload
- Supported Datastore
- Django Version
- JSON Version
- PyCrypto Version
- Python Imaging Library
- PyYaml Version
- WebApp Version
- WebApp Templates
- Webob Version
- djangoforms Support
- zipimport Support
- Supported Third-Party Libraries
- Preferred Interface (WSGI vs. CGI)
- Support for C modules
- Runtime version in app.yaml
Feature | Python 2.5 Behavior | Python 2.7 Behavior |
---|---|---|
Multithreading | Not available. |
You can use the Python 2.7 threading library . All threads in a request must finish before the request deadline (60 seconds for online requests and 10 minutes for offline). |
Concurrent requests | Not supported. |
Can use concurrent requests as long as you specify the
threadsafe directive
in
In backends, raising an exception from a shutdown hook copies that exception to all threads. |
Bytecode modification | Not possible to modify bytecode because of restrictions in the runtime. | No longer restricts access to Python bytecode. Libraries that generate or manipulate bytecode (such as the jinja2 templating library) can do so in this runtime. Applications can create, modify, and execute arbitrary bytecode. This can make some libraries more efficient (such as the jinja2 templating library), but if your application relies on the restrictions in Python 2.5 for security, you need to update it. |
Bytecode upload | Not available. |
Can upload
|
Supported Datastore |
High Replication Datastore (preferred)
Master/Slave Datastore (deprecated) |
Supports only the High Replication Datastore (HRD). If your application uses the Master/Slave Datastore, you need to migrate it to the HRD. |
Django version | Supports Django 0.96 and 1.2. | Supports only Django 1.2. See Porting Your Apps from Django .96 to 1.2 for upgrade details. Django 1.2 automatically HTML-escapes the output of every variable. This may break some templates (but fixes some security bugs). For instructions on how to enable Django 1.2 in your application, see Third-party Python Libraries . |
JSON version | Supports simplejson. | Uses the native JSON library , which is much faster than simplejson. |
PyCrypto version | Supports PyCrypto 2.0.1 with restrictions (see the PyCrypto documentation for more information). |
Supports PyCrypto 2.3 with C-accelerated public key encryption.
Supports PyCrypto 2.6. |
Python Imaging Library | Not supported. (Although PIL must be installed locally if you wish to use the App Engine Images API with the development server to support testing of your app.) |
Supported. You must declare the library in the
libraries
section of the
app.yaml
file.
(If you wish to use PIL or the App Engine Images API with the development server, you also need to install PIL locally.) |