Porting to Python 3

Porting to Python 3

Django 1.5 is the first version of Django to support Python 3. The same code runs both on Python 2 (≥ 2.6.5) and Python 3 (≥ 3.2), thanks to the six compatibility layer.

This document is primarily targeted at authors of pluggable applications who want to support both Python 2 and 3. It also describes guidelines that apply to Django’s code.

Philosophy

This document assumes that you are familiar with the changes between Python 2 and Python 3. If you aren’t, read 登录查看完整内容