python3.rst
This file
Path
docs/python3.rst
62 lines · 2.2 KiB
Last changed by
Merge pull request #1112 from methane/patch-3Daniel Neuhäuserbefore adoptionc048aed
History of this fileTake it
The walk stopped after 200 commits: lines older than 2e17ad7 point at it.
Merge pull request #816 from untitaker/allowed_methodsArmin Ronacherbefore adoption2e17ad7
lines 1–21why, one step back1.. _python3-support: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.910Requirements11------------1213If you want to use Flask with Python 3 you will need to use Python 3.3 or14higher. 3.2 and older are *not* supported.1516In addition to that you need to use the latest and greatest versions of17`itsdangerous`, `Jinja2` and `Werkzeug`.1819API Stability20-------------21Merge pull request #1055 from IanConnolly/doc-fixKenneth Reitzbefore adoption332fa79
line 22why, one step back22Some of the decisions made in regards to unicode and byte utilization onMerge pull request #816 from untitaker/allowed_methodsArmin Ronacherbefore adoption2e17ad7
lines 23–35why, one step back23Python 3 make it hard to write low level code. This mainly affects WSGI24middlewares and interacting with the WSGI provided information. Werkzeug25wraps all that information in high-level helpers but some of those were26specifically added for the Python 3 support and are quite new.2728A lot of the documentation out there on using WSGI leaves out those29details as it was written before WSGI was updated to Python 3. While the30API for Werkzeug and Flask on Python 2.x should not change much we cannot31guarantee that this won't happen on Python 3.3233Few Users34---------35Merge pull request #1112 from methane/patch-3Daniel Neuhäuserbefore adoptionc048aed
lines 36–37why, one step back36Although moving to Python 3 should be done someday, most people still use37Python 2 for now. As a result many of the problems you will encounter areMerge pull request #816 from untitaker/allowed_methodsArmin Ronacherbefore adoption2e17ad7
lines 38–42why, one step back38probably hard to search for on the internet if they are Python 3 specific.3940Small Ecosystem41---------------42Merge pull request #1112 from methane/patch-3Daniel Neuhäuserbefore adoptionc048aed
lines 43–45why, one step back43Some Flask extensions, documentation and PyPI provided libraries do not44support Python 3 yet.45Merge pull request #816 from untitaker/allowed_methodsArmin Ronacherbefore adoption2e17ad7
line 46why, one step back46Even if you start your project with knowing that all you will need isMerge pull request #1112 from methane/patch-3Daniel Neuhäuserbefore adoptionc048aed
lines 47–49why, one step back47supported by Python 3 you don't know what happens six months from now.48But if you are familiar with Python 3 and Flask extension, you can start49porting libraries on your own.Merge pull request #816 from untitaker/allowed_methodsArmin Ronacherbefore adoption2e17ad7
lines 50–62why, one step back5051Recommendations52---------------5354Unless you are already familiar with the differences in the versions we55recommend sticking to current versions of Python until the ecosystem56caught up.5758The majority of the upgrade pain is in the lower-level libararies like59Flask and Werkzeug and not in the actual high-level application code. For60instance all of the Flask examples that are in the Flask repository work61out of the box on both 2.x and 3.x and did not require a single line of62code changed.