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:
- 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
Important: To run Python 2.5 apps locally, you'll need
old_devappserver.py from SDK version 1.9.15. SDK versions
newer than 1.9.15 no longer include a development server
compatible with Python 2.5 apps.
If you need to download older SDKs to obtain the development server for Python 2.5 apps, you can access these at https://console.developers.google.com/storage/appengine-sdks/deprecated/.
|Feature||Python 2.5 Behavior||Python 2.7 Behavior|
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.||
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.||
|Supported Datastore||High Replication Datastore.||High Replication Datastore.|
|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.||simplejson is not available. Use the native JSON module, json, 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
section of the
(If you wish to use PIL or the App Engine Images API with the development server, you also need to install PIL locally.)
|PyYaml version||Version 3.0.5||Version 3.10. For differences, see the PyYaml documentation.|
|WebApp templates||Supports WebApp templates||WebApp templates are deprecated. Instead, you can use the third-party templating libraries packaged with the runtime (jinja2 or Django templates).|
|Webob version||Supports WebOb 0.9.||Supports WebOb 1.1.1. Version 1.1.1 is not fully backward-compatible with WebOb 0.9. If you are upgrading an application that uses WebOb 0.9, you need to test the WebOb functionality extensively and update your application for the new version.|
|djangoforms support||djangoforms is directly supported as
||djangoforms is not supported but third-party alternatives such as WTForms can be used.|
|zipimport support||zipimport is supported.||zipimport is not supported, but Python 2.7 can natively import from
|Supported third-party libraries||Supports the following third-party libraries and versions:
Django 0.96, 1.0, 1.1, 1.2
|Preferred interface (WSGI vs. CGI)||CGI is the only supported interface.||WSGI is the preferred interface, and is required for multithreading. For more information about converting CGI handlers to WSGI, see Migrating to Python 2.7.|
|Support for C modules||Some C modules are not available. See the libraries knowledge base for more information.||The following C modules are not available:
|Runtime version in