Skip to content
Myr

clean up py3 info more

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 00c200e · Browse files · 2 files+18 added−28 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+18 added−28 removed

  • other:+18 added−28 removed

2 files+18 added−28 removed

modified:docs/advanced_foreword.rst+3 added-3 removed
45 unmodified lines
46Flask is no different from any other framework in that you the developer must47build with caution, watching for exploits when building to your requirements.4849Python 3 Support in Flask50----------------------50-------------------------5152If you think of using Flask with Python 3 have a look at the53:ref:`python3-support` page.52Flask, its dependencies, and most Flask extensions all support Python 3.53If you want to use Flask with Python 3 have a look at the :ref:`python3-support` page.5455Continue to :ref:`installation` or the :ref:`quickstart`.
modified:docs/python3.rst+15 added-25 removed
1 unmodified line
23Python 3 Support4================56Flask and all of its dependencies support Python 3 so you can in theory7start working on it already. There are however a few things you should be8aware of before you start using Python 3 for your next project.6Flask, its dependencies, and most Flask extensions support Python 3.7You should start using Python 3 for your next project,8but there are a few things to be aware of.910If you want to use Flask with Python 3 you will need to use Python 3.3 or11higher. 3.2 and older are *not* supported.10You need to use Python 3.3 or higher. 3.2 and older are *not* supported.1113In addition to that you need to use the latest and greatest versions of14`itsdangerous`, `Jinja2` and `Werkzeug`. Flask 0.10 and Werkzeug 0.9 were15the first versions to introduce Python 3 support.12You should use the latest versions of all Flask-related packages.13Flask 0.10 and Werkzeug 0.9 were the first versions to introduce Python 3 support.1417Some of the decisions made in regards to unicode and byte utilization on18Python 3 make it hard to write low level code. This mainly affects WSGI19middlewares and interacting with the WSGI provided information. Werkzeug20wraps all that information in high-level helpers but some of those were21specifically added for the Python 3 support and are quite new.15Python 3 changed how unicode and bytes are handled,16which complicated how low level code handles HTTP data.17This mainly affects WSGI middleware interacting with the WSGI ``environ`` data.18Werkzeug wraps that information in high-level helpers,19so encoding issues should not effect you.2023Unless you require absolute compatibility, you should be fine with Python 324nowadays. Most libraries and Flask extensions have been ported by now and25using Flask with Python 3 is generally a smooth ride. However, keep in mind26that most libraries (including Werkzeug and Flask) might not quite as stable27on Python 3 yet. You might therefore sometimes run into bugs that are28usually encoding-related.2930The majority of the upgrade pain is in the lower-level libraries like31Flask and Werkzeug and not in the actual high-level application code. For32instance all of the Flask examples that are in the Flask repository work33out of the box on both 2.x and 3.x and did not require a single line of34code changed.21The majority of the upgrade work is in the lower-level libraries like22Flask and Werkzeug, not the high-level application code.23For example, all of the examples in the Flask repository work on both Python 2 and 324and did not require a single line of code changed.