Merge branch '1.0.x'
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 · parents dbe51dc, 31d3c7e · Browse files · 84 files·+1029 added−1439 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
84 files+1029 added−1439 removed
- tests:+36 added−36 removed
- other:+993 added−1403 removed
Provenance
- Commit
1351d0a- Tree
3a5b6bd- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
dbe51dc- Parent 2
31d3c7e
84 files changed+1029 added−1439 removed
deleted:artwork/LICENSE-20 removed
1-Copyright (c) 2010 by Armin Ronacher.2-3-Some rights reserved.4-5-This logo or a modified version may be used by anyone to refer to the6-Flask project, but does not indicate endorsement by the project.7-8-Redistribution and use in source (the SVG file) and binary forms (rendered9-PNG files etc.) of the image, with or without modification, are permitted10-provided that the following conditions are met:11-12-* Redistributions of source code must retain the above copyright13- notice and this list of conditions.14-15-* The names of the contributors to the Flask software (see AUTHORS) may16- not be used to endorse or promote products derived from this software17- without specific prior written permission.18-19-Note: we would appreciate that you make the image a link to20-http://flask.pocoo.org/ if you use it on a web page.added:artwork/LICENSE.rst+19 added
1+Copyright 2010 Pallets2+3+This logo or a modified version may be used by anyone to refer to the4+Flask project, but does not indicate endorsement by the project.5+6+Redistribution and use in source (SVG) and binary (renders in PNG, etc.)7+forms, with or without modification, are permitted provided that the8+following conditions are met:9+10+1. Redistributions of source code must retain the above copyright11+ notice and this list of conditions.12+13+3. Neither the name of the copyright holder nor the names of its14+ contributors may be used to endorse or promote products derived from15+ this software without specific prior written permission.16+17+We would appreciate that you make the image a link to18+https://palletsprojects.com/p/flask/ if you use it in a medium that19+supports links.modified:docs/_static/flask-icon.pngbinary
A binary file, modified.
deleted:docs/_static/flask-logo-sidebar.pngbinary
A binary file, deleted.
modified:docs/deploying/cgi.rst+1 added-1 removed
56 unmodified lines57 RewriteRule ^(.*)$ /path/to/the/application.cgi/$1 [L]58 59 For more information consult the documentation of your webserver.60 61-.. _App Engine: https://developers.google.com/appengine/61+.. _App Engine: https://cloud.google.com/appengine/docs/modified:docs/deploying/index.rst+1 added-4 removed
15 unmodified lines16 Hosted options17 --------------18 19 - `Deploying Flask on Heroku <https://devcenter.heroku.com/articles/getting-started-with-python>`_20-- `Deploying Flask on OpenShift <https://developers.openshift.com/en/python-flask.html>`_21-- `Deploying Flask on Webfaction <http://flask.pocoo.org/snippets/65/>`_20 - `Deploying Flask on Google App Engine <https://cloud.google.com/appengine/docs/standard/python/getting-started/python-standard-env>`_21 - `Deploying Flask on AWS Elastic Beanstalk <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html>`_24-- `Sharing your Localhost Server with Localtunnel <http://flask.pocoo.org/snippets/89/>`_25-- `Deploying on Azure (IIS) <https://azure.microsoft.com/documentation/articles/web-sites-python-configure/>`_22+- `Deploying on Azure (IIS) <https://docs.microsoft.com/en-us/azure/app-service/containers/how-to-configure-python>`_23 - `Deploying on PythonAnywhere <https://help.pythonanywhere.com/pages/Flask/>`_24 25 Self-hosted options26 -------------------9 unmodified linesmodified:docs/deploying/uwsgi.rst+1 added-1 removed
68 unmodified lines69 70 .. _nginx: https://nginx.org/71 .. _lighttpd: https://www.lighttpd.net/72 .. _cherokee: http://cherokee-project.com/73-.. _uwsgi: https://uwsgi-docs.readthedocs.io/73+.. _uwsgi: https://uwsgi-docs.readthedocs.io/en/latest/modified:docs/deploying/wsgi-standalone.rst+1 added-1 removed
83 unmodified lines84 application from ``myproject``::85 86 $ twistd -n web --port tcp:8080 --wsgi myproject.app87 88-.. _Twisted: https://twistedmatrix.com/88+.. _Twisted: https://twistedmatrix.com/trac/89 .. _Twisted Web: https://twistedmatrix.com/trac/wiki/TwistedWeb90 91 .. _deploying-proxy-setups:92 63 unmodified linesmodified:docs/patterns/appfactories.rst+1 added-1 removed
58 unmodified lines59 60 It's preferable to create your extensions and app factories so that the61 extension object does not initially get bound to the application.62 63-Using `Flask-SQLAlchemy <http://flask-sqlalchemy.pocoo.org/>`_,63+Using `Flask-SQLAlchemy <https://flask-sqlalchemy.palletsprojects.com/>`_,64 as an example, you should not do something along those lines::65 66 def create_app(config_filename):67 app = Flask(__name__)50 unmodified linesmodified:docs/patterns/errorpages.rst+26 added
95 unmodified lines96 <h1>Page Not Found</h1>97 <p>What you were looking for is just not there.98 <p><a href="{{ url_for('index') }}">go somewhere nice</a>99 {% endblock %}100+101+102+Returning API errors as JSON103+----------------------------104+105+When using Flask for web APIs, you can use the same techniques as above106+to return JSON responses to API errors. :func:`~flask.abort` is called107+with a ``description`` parameter. The :meth:`~flask.errorhandler` will108+use that as the JSON error message, and set the status code to 404.109+110+.. code-block:: python111+112+ from flask import abort, jsonify113+114+ @app.errorhandler(404)115+ def resource_not_found(e):116+ return jsonify(error=str(e)), 404117+118+ @app.route("/cheese")119+ def get_one_cheese():120+ resource = get_resource()121+122+ if resource is None:123+ abort(404, description="Resource not found")124+125+ return jsonify(resource)modified:docs/patterns/jquery.rst+1 added-1 removed
25 unmodified lines26 <script type=text/javascript src="{{27 url_for('static', filename='jquery.js') }}"></script>28 29 Another method is using Google's `AJAX Libraries API30-<https://developers.google.com/speed/libraries/devguide>`_ to load jQuery:30+<https://developers.google.com/speed/libraries/>`_ to load jQuery:31 32 .. sourcecode:: html33 34 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>133 unmodified linesmodified:docs/patterns/sqlalchemy.rst+1 added-1 removed
20 unmodified lines21 22 You can download `Flask-SQLAlchemy`_ from `PyPI23 <https://pypi.org/project/Flask-SQLAlchemy/>`_.24 25-.. _Flask-SQLAlchemy: http://flask-sqlalchemy.pocoo.org/25+.. _Flask-SQLAlchemy: https://flask-sqlalchemy.palletsprojects.com/26 27 28 Declarative29 -----------189 unmodified linesmodified:docs/tutorial/deploy.rst+1 added-1 removed
114 unmodified lines115 your application. Waitress is just an example, chosen for the tutorial116 because it supports both Windows and Linux. There are many more WSGI117 servers and deployment options that you may choose for your project.118 119-.. _Waitress: https://docs.pylonsproject.org/projects/waitress/119+.. _Waitress: https://docs.pylonsproject.org/projects/waitress/en/stable/120 121 Continue to :doc:`next`.modified:docs/tutorial/install.rst+1 added-1 removed
68 unmodified lines69 70 See the `official packaging guide`_ for another explanation of the files71 and options used.72 73-.. _official packaging guide: https://packaging.python.org/tutorials/distributing-packages/73+.. _official packaging guide: https://packaging.python.org/tutorials/packaging-projects/74 75 76 Install the Project77 -------------------37 unmodified linesmodified:docs/api.rst+3 added-3 removed
41 unmodified lines42 .. attribute:: url43 .. attribute:: base_url44 .. attribute:: url_root45 46- Provides different ways to look at the current `IRI47- <https://tools.ietf.org/html/rfc3987>`_. Imagine your application is48- listening on the following application root::46+ Provides different ways to look at the current :rfc:`3987`.47+ Imagine your application is listening on the following application48+ root::49 50 http://www.example.com/myapplication51 52 And a user requests the following URI::781 unmodified linesmodified:docs/becomingbig.rst+1 added-1 removed
43 unmodified lines44 The :ref:`app-dispatch` chapter shows in detail how to apply middleware. You45 can introduce WSGI middleware to wrap your Flask instances and introduce fixes46 and changes at the layer between your Flask application and your HTTP47 server. Werkzeug includes several `middlewares48-<http://werkzeug.pocoo.org/docs/middlewares/>`_.48+<https://werkzeug.palletsprojects.com/middleware/>`_.49 50 Fork.51 -----52 50 unmodified linesmodified:docs/changelog.rst+3 added
1+Changelog2+=========3+4 .. include:: ../CHANGES.rstmodified:docs/cli.rst+7 added-8 removed
8 unmodified lines9 interface, in your virtualenv. Executed from the terminal, this script gives10 access to built-in, extension, and application-defined commands. The ``--help``11 option will give more information about any commands and options.12 13-.. _Click: http://click.pocoo.org/13+.. _Click: https://click.palletsprojects.com/14 15 16 Application Discovery17 ---------------------253 unmodified lines271 272 The ``flask`` command is implemented using `Click`_. See that project's273 documentation for full information about writing commands.274 275-This example adds the command ``create_user`` that takes the argument275+This example adds the command ``create-user`` that takes the argument276 ``name``. ::277 278 import click279 from flask import Flask280 281 app = Flask(__name__)282 283- @app.cli.command()284- @click.argument('name')283+ @app.cli.command("create-user")284+ @click.argument("name")285 def create_user(name):286 ...287 288 ::289 290- $ flask create_user admin290+ $ flask create-user admin291 292 This example adds the same command, but as ``user create``, a command in a293 group. This is useful if you want to organize multiple related commands. ::294 14 unmodified lines309 ::310 311 $ flask user create demo312 313-313 See :ref:`testing-cli` for an overview of how to test your custom314 commands.315 316 98 unmodified lines415 },416 )417 418 420-.. _entry point: https://packaging.python.org/tutorials/distributing-packages/#entry-points419+.. _entry point: https://packaging.python.org/tutorials/packaging-projects/#entry-points420 421 Inside :file:`flask_my_extension/commands.py` you can then export a Click422 object::423 60 unmodified lines484 485 The ``flask`` command, being separate from your code, does not have486 this issue and is recommended in most cases.487 489-.. _console script: https://packaging.python.org/tutorials/distributing-packages/#console-scripts488+.. _console script: https://packaging.python.org/tutorials/packaging-projects/#console-scripts489 490 491 PyCharm Integration492 -------------------50 unmodified linesmodified:docs/conf.py+7 added-19 removed
1-from __future__ import print_function2-1 from pallets_sphinx_themes import get_version2 from pallets_sphinx_themes import ProjectLink3 4 # Project --------------------------------------------------------------5 6 project = "Flask"9-copyright = "2010 Pallets Team"10-author = "Pallets Team"7+copyright = "2010 Pallets"8+author = "Pallets"9 release, version = get_version("Flask")10 11 # General --------------------------------------------------------------12 6 unmodified lines19 "sphinx_issues",20 ]21 intersphinx_mapping = {22 "python": ("https://docs.python.org/3/", None),25- "werkzeug": ("http://werkzeug.pocoo.org/docs/", None),23+ "werkzeug": ("https://werkzeug.palletsprojects.com/", None),24 "click": ("https://click.palletsprojects.com/", None),25 "jinja": ("http://jinja.pocoo.org/docs/", None),26 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),27 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),15 unmodified lines43 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),44 ]45 }46 html_sidebars = {49- "index": ["project.html", "localtoc.html", "versions.html", "searchbox.html"],50- "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],47+ "index": ["project.html", "localtoc.html", "searchbox.html"],48+ "**": ["localtoc.html", "relations.html", "searchbox.html"],49 }52-singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}50+singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}51 html_static_path = ["_static"]52 html_favicon = "_static/flask-icon.png"55-html_logo = "_static/flask-logo-sidebar.png"53+html_logo = "_static/flask-icon.png"54 html_title = "Flask Documentation ({})".format(version)55 html_show_sourcelink = False58-html_domain_indices = False56 57 # LaTeX ----------------------------------------------------------------58 59 latex_documents = [60 (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")61 ]65-latex_use_modindex = False66-latex_elements = {67- "papersize": "a4paper",68- "pointsize": "12pt",69- "fontpkg": r"\usepackage{mathpazo}",70- "preamble": r"\usepackage{flaskstyle}",71-}72-latex_use_parts = True73-latex_additional_files = ["flaskstyle.sty", "logo.pdf"]62 63 # Local Extensions -----------------------------------------------------64 65 30 unmodified linesdeleted:docs/contents.rst.inc-62 removed
1-User's Guide2-------------3-4-This part of the documentation, which is mostly prose, begins with some5-background information about Flask, then focuses on step-by-step6-instructions for web development with Flask.7-8-.. toctree::9- :maxdepth: 210-11- foreword12- advanced_foreword13- installation14- quickstart15- tutorial/index16- templating17- testing18- errorhandling19- logging20- config21- signals22- views23- appcontext24- reqcontext25- blueprints26- extensions27- cli28- server29- shell30- patterns/index31- deploying/index32- becomingbig33-34-API Reference35--------------36-37-If you are looking for information on a specific function, class or38-method, this part of the documentation is for you.39-40-.. toctree::41- :maxdepth: 242-43- api44-45-Additional Notes46-----------------47-48-Design notes, legal information and changelog are here for the interested.49-50-.. toctree::51- :maxdepth: 252-53- design54- htmlfaq55- security56- unicode57- extensiondev58- styleguide59- upgrading60- changelog61- license62- contributingmodified:docs/extensiondev.rst+5 added-6 removed
2 unmodified lines3 Flask Extension Development4 ===========================5 6 Flask, being a microframework, often requires some repetitive steps to get7-a third party library working. Because very often these steps could be8-abstracted to support multiple projects the `Flask Extension Registry`_9-was created.7+a third party library working. Many such extensions are already available8+on `PyPI <https://pypi.org/search/?c=Framework+%3A%3A+Flask>`_.9 10 If you want to create your own Flask extension for something that does not11 exist yet, this guide to extension development will help you get your12 extension running in no time and to feel like users would expect your313 unmodified lines326 *ExtensionName-Flask*.327 6. Approved extensions must define all their dependencies in the328 :file:`setup.py` file unless a dependency cannot be met because it is not329 available on PyPI.331-7. The documentation must use the ``flask`` theme from the `Official332- Pallets Themes`_.330+7. The documentation must use the ``flask`` theme from the331+ `Official Pallets Themes`_.332 8. The setup.py description (and thus the PyPI description) has to333 link to the documentation, website (if there is one) and there334 must be a link to automatically install the development version335 (``PackageName==dev``).4 unmodified lines340 341 .. _OAuth extension: https://pythonhosted.org/Flask-OAuth/342 .. _mailinglist: http://flask.pocoo.org/mailinglist/343 .. _IRC channel: http://flask.pocoo.org/community/irc/345-.. _Official Pallets Themes: https://pypi.org/project/pallets-sphinx-themes/344+.. _Official Pallets Themes: https://pypi.org/project/Pallets-Sphinx-Themes/deleted:docs/flaskstyle.sty-124 removed
1-\definecolor{TitleColor}{rgb}{0,0,0}2-\definecolor{InnerLinkColor}{rgb}{0,0,0}3-4-% Replace Unicode character 'PARTY POPPER' (U+1F389) with a non-breaking space.5-% pdfLaTeX doesn't support Unicode.6-\DeclareUnicodeCharacter{1F389}{\nobreakspace}7-8-\renewcommand{\maketitle}{%9- \begin{titlepage}%10- \let\footnotesize\small11- \let\footnoterule\relax12- % Apply following fix only on PDF output, i.e. pdfoutput macro is not13- % undefined14- \ifx\pdfoutput\undefined\else15- \begingroup16- % This \def is required to deal with multi-line authors; it17- % changes \\ to ', ' (comma-space), making it pass muster for18- % generating document info in the PDF file.19- \def\\{, }20- \pdfinfo{21- /Author (\@author)22- /Title (\@title)23- }24- \endgroup25- \fi26- \begin{flushright}%27- %\sphinxlogo%28- {\center29- \vspace*{3cm}30- \includegraphics{logo.pdf}31- \vspace{3cm}32- \par33- {\rm\Huge \@title \par}%34- {\em\LARGE \py@release\releaseinfo \par}35- {\large36- \@date \par37- \py@authoraddress \par38- }}%39- \end{flushright}%\par40- \@thanks41- \end{titlepage}%42- \cleardoublepage%43- \setcounter{footnote}{0}%44- \let\thanks\relax\let\maketitle\relax45- %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}46-}47-48-\fancypagestyle{normal}{49- \fancyhf{}50- \fancyfoot[LE,RO]{{\thepage}}51- \fancyfoot[LO]{{\nouppercase{\rightmark}}}52- \fancyfoot[RE]{{\nouppercase{\leftmark}}}53- \fancyhead[LE,RO]{{ \@title, \py@release}}54- \renewcommand{\headrulewidth}{0.4pt}55- \renewcommand{\footrulewidth}{0.4pt}56-}57-58-\fancypagestyle{plain}{59- \fancyhf{}60- \fancyfoot[LE,RO]{{\thepage}}61- \renewcommand{\headrulewidth}{0pt}62- \renewcommand{\footrulewidth}{0.4pt}63-}64-65-\titleformat{\section}{\Large}%66- {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor}67-\titleformat{\subsection}{\large}%68- {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}69-\titleformat{\subsubsection}{}%70- {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}71-\titleformat{\paragraph}{\large}%72- {\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor}73-74-\ChNameVar{\raggedleft\normalsize}75-\ChNumVar{\raggedleft \bfseries\Large}76-\ChTitleVar{\raggedleft \rm\Huge}77-78-\renewcommand\thepart{\@Roman\c@part}79-\renewcommand\part{%80- \pagestyle{plain}81- \if@noskipsec \leavevmode \fi82- \cleardoublepage83- \vspace*{6cm}%84- \@afterindentfalse85- \secdef\@part\@spart}86-87-\def\@part[#1]#2{%88- \ifnum \c@secnumdepth >\m@ne89- \refstepcounter{part}%90- \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%91- \else92- \addcontentsline{toc}{part}{#1}%93- \fi94- {\parindent \z@ %\center95- \interlinepenalty \@M96- \normalfont97- \ifnum \c@secnumdepth >\m@ne98- \rm\Large \partname~\thepart99- \par\nobreak100- \fi101- \MakeUppercase{\rm\Huge #2}%102- \markboth{}{}\par}%103- \nobreak104- \vskip 8ex105- \@afterheading}106-\def\@spart#1{%107- {\parindent \z@ %\center108- \interlinepenalty \@M109- \normalfont110- \huge \bfseries #1\par}%111- \nobreak112- \vskip 3ex113- \@afterheading}114-115-% use inconsolata font116-\usepackage{inconsolata}117-118-% fix single quotes, for inconsolata. (does not work)119-%%\usepackage{textcomp}120-%%\begingroup121-%% \catcode`'=\active122-%% \g@addto@macro\@noligs{\let'\textsinglequote}123-%% \endgroup124-%%\endinputmodified:docs/htmlfaq.rst+1 added-1 removed
184 unmodified lines185 Many other features have been added, as well. A good guide to new features186 in HTML5 is Mark Pilgrim's soon-to-be-published book, `Dive Into HTML5`_.187 Not all of them are supported in browsers yet, however, so use caution.188 189-.. _Dive Into HTML5: http://diveintohtml5.info/table-of-contents.html189+.. _Dive Into HTML5: https://diveintohtml5.info/190 191 What should be used?192 --------------------193 14 unmodified linesmodified:docs/index.rst+66 added-2 removed
19 unmodified lines20 Flask depends on the `Jinja`_ template engine and the `Werkzeug`_ WSGI21 toolkit. The documentation for these libraries can be found at:22 23 - `Jinja documentation <http://jinja.pocoo.org/docs>`_24-- `Werkzeug documentation <http://werkzeug.pocoo.org/docs>`_24+- `Werkzeug documentation <https://werkzeug.palletsprojects.com/>`_25 26 .. _Jinja: https://www.palletsprojects.com/p/jinja/27 .. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/28 29-.. include:: contents.rst.inc29+30+User's Guide31+------------32+33+This part of the documentation, which is mostly prose, begins with some34+background information about Flask, then focuses on step-by-step35+instructions for web development with Flask.36+37+.. toctree::38+ :maxdepth: 239+40+ foreword41+ advanced_foreword42+ installation43+ quickstart44+ tutorial/index45+ templating46+ testing47+ errorhandling48+ logging49+ config50+ signals51+ views52+ appcontext53+ reqcontext54+ blueprints55+ extensions56+ cli57+ server58+ shell59+ patterns/index60+ deploying/index61+ becomingbig62+63+64+API Reference65+-------------66+67+If you are looking for information on a specific function, class or68+method, this part of the documentation is for you.69+70+.. toctree::71+ :maxdepth: 272+73+ api74+75+76+Additional Notes77+----------------78+79+Design notes, legal information and changelog are here for the interested.80+81+.. toctree::82+ :maxdepth: 283+84+ design85+ htmlfaq86+ security87+ unicode88+ extensiondev89+ styleguide90+ upgrading91+ changelog92+ license93+ contributingmodified:docs/installation.rst+5 added-5 removed
23 unmodified lines24 to protect Flask's session cookie.25 * `Click`_ is a framework for writing command line applications. It provides26 the ``flask`` command and allows adding custom management commands.27 28-.. _Werkzeug: http://werkzeug.pocoo.org/29-.. _Jinja: http://jinja.pocoo.org/30-.. _MarkupSafe: https://pypi.org/project/MarkupSafe/31-.. _ItsDangerous: https://pythonhosted.org/itsdangerous/32-.. _Click: http://click.pocoo.org/28+.. _Werkzeug: https://palletsprojects.com/p/werkzeug/29+.. _Jinja: https://palletsprojects.com/p/jinja/30+.. _MarkupSafe: https://palletsprojects.com/p/markupsafe/31+.. _ItsDangerous: https://palletsprojects.com/p/itsdangerous/32+.. _Click: https://palletsprojects.com/p/click/33 34 Optional dependencies35 ~~~~~~~~~~~~~~~~~~~~~36 150 unmodified linesdeleted:docs/latexindex.rst-6 removed
1-:orphan:2-3-Flask Documentation4-===================5-6-.. include:: contents.rst.incmodified:docs/license.rst+10 added-39 removed
1 License2 =======3 4-Flask is licensed under a three clause BSD License. It basically means:5-do whatever you want with it as long as the copyright in Flask sticks6-around, the conditions are not modified and the disclaimer is present.7-Furthermore you must not use the names of the authors to promote derivatives8-of the software without written consent.4+Source License5+--------------6 10-The full license text can be found below (:ref:`flask-license`). For the11-documentation and artwork different licenses apply.7+This license applies to all files in the Flask repository and source8+distribution. This includes Flask's source code, the examples, and9+tests, as well as the documentation.10 13-.. _authors:11+.. include:: ../LICENSE.rst12 15-Authors16--------13 18-.. include:: ../AUTHORS14+Artwork License15+---------------16 20-General License Definitions21----------------------------17+This license applies to Flask's logo.18 23-The following section contains the full license texts for Flask and the24-documentation.25-26-- "AUTHORS" hereby refers to all the authors listed in the27- :ref:`authors` section.28-29-- The ":ref:`flask-license`" applies to all the source code shipped as30- part of Flask (Flask itself as well as the examples and the unittests)31- as well as documentation.32-33-- The ":ref:`artwork-license`" applies to the project's Horn-Logo.34-35-.. _flask-license:36-37-Flask License38--------------39-40-.. include:: ../LICENSE41-42-43-.. _artwork-license:44-45-Flask Artwork License46----------------------47-48-.. include:: ../artwork/LICENSE19+.. include:: ../artwork/LICENSE.rstdeleted:docs/logo.pdfbinary
A binary file, deleted.
modified:docs/make.bat+35 added-36 removed
1-@ECHO OFF2-3-pushd %~dp04-5-REM Command file for Sphinx documentation6-7-if "%SPHINXBUILD%" == "" (8- set SPHINXBUILD=sphinx-build9-)10-set SOURCEDIR=.11-set BUILDDIR=_build12-set SPHINXPROJ=Flask13-14-if "%1" == "" goto help15-16-%SPHINXBUILD% >NUL 2>NUL17-if errorlevel 9009 (18- echo.19- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx20- echo.installed, then set the SPHINXBUILD environment variable to point21- echo.to the full path of the 'sphinx-build' executable. Alternatively you22- echo.may add the Sphinx directory to PATH.23- echo.24- echo.If you don't have Sphinx installed, grab it from25- echo.https://www.sphinx-doc.org/26- exit /b 127-)28-29-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30-goto end31-32-:help33-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%34-35-:end36-popd1+@ECHO OFF2+3+pushd %~dp04+5+REM Command file for Sphinx documentation6+7+if "%SPHINXBUILD%" == "" (8+ set SPHINXBUILD=sphinx-build9+)10+set SOURCEDIR=.11+set BUILDDIR=_build12+13+if "%1" == "" goto help14+15+%SPHINXBUILD% >NUL 2>NUL16+if errorlevel 9009 (17+ echo.18+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx19+ echo.installed, then set the SPHINXBUILD environment variable to point20+ echo.to the full path of the 'sphinx-build' executable. Alternatively you21+ echo.may add the Sphinx directory to PATH.22+ echo.23+ echo.If you don't have Sphinx installed, grab it from24+ echo.http://sphinx-doc.org/25+ exit /b 126+)27+28+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%29+goto end30+31+:help32+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%33+34+:end35+popdmodified:docs/Makefile-1 removed
2 unmodified lines3 4 # You can set these variables from the command line.5 SPHINXOPTS =6 SPHINXBUILD = sphinx-build7-SPHINXPROJ = Flask7 SOURCEDIR = .8 BUILDDIR = _build9 10 # Put it first so that "make" without argument is like "make help".9 unmodified linesmodified:docs/quickstart.rst+6 added-7 removed
67 unmodified lines68 This launches a very simple builtin server, which is good enough for testing69 but probably not what you want to use in production. For deployment options see70 :ref:`deployment`.71 72-Now head over to `http://127.0.0.1:5000/ <http://127.0.0.1:5000/>`_, and you73-should see your hello world greeting.72+Now head over to http://127.0.0.1:5000/, and you should see your hello73+world greeting.74 75 .. _public-server:76 77 .. admonition:: Externally Visible Server88 unmodified lines166 167 More information on using the debugger can be found in the `Werkzeug168 documentation`_.169 170-.. _Werkzeug documentation: http://werkzeug.pocoo.org/docs/debug/#using-the-debugger170+.. _Werkzeug documentation: https://werkzeug.palletsprojects.com/debug/#using-the-debugger171 172 Have another debugger in mind? See :ref:`working-with-debuggers`.173 174 213 unmodified lines388 /hello.html389 390 For templates you can use the full power of Jinja2 templates. Head over391 to the official `Jinja2 Template Documentation392-<http://jinja.pocoo.org/docs/templates>`_ for more information.392+<http://jinja.pocoo.org/docs/templates/>`_ for more information.393 394 Here is an example template:395 396 .. sourcecode:: html+jinja464 unmodified lines861 app.logger.warning('A warning occurred (%d apples)', 42)862 app.logger.error('An error occurred')863 864 The attached :attr:`~flask.Flask.logger` is a standard logging865-:class:`~logging.Logger`, so head over to the official `logging866-documentation <https://docs.python.org/library/logging.html>`_ for more867-information.865+:class:`~logging.Logger`, so head over to the official :mod:`logging`866+docs for more information.867 868 Read more on :ref:`application-errors`.869 870 Hooking in WSGI Middlewares23 unmodified linesmodified:docs/requirements.txt+2 added-2 removed
1-Sphinx~=1.8.02-Pallets-Sphinx-Themes~=1.1.01+Sphinx~=2.1.22+Pallets-Sphinx-Themes~=1.1.43 sphinxcontrib-log-cabinet~=1.0.04 sphinx-issues~=1.2.0modified:docs/templating.rst+1 added-1 removed
9 unmodified lines10 11 This section only gives a very quick introduction into how Jinja212 is integrated into Flask. If you want information on the template13 engine's syntax itself, head over to the official `Jinja2 Template14-Documentation <http://jinja.pocoo.org/docs/templates>`_ for14+Documentation <http://jinja.pocoo.org/docs/templates/>`_ for15 more information.16 17 Jinja Setup18 -----------218 unmodified linesmodified:docs/testing.rst+3 added-4 removed
18 unmodified lines19 framework for our tests. You can install it with ``pip``, like so::20 21 $ pip install pytest22 23-.. _pytest:24- https://pytest.org23+.. _pytest: https://docs.pytest.org/24 25 The Application26 ---------------27 425 unmodified lines453 def test_hello_params():454 context = hello_command.make_context('hello', ['--name', 'flask'])455 assert context.params['name'] == 'FLASK'456 458-.. _click: http://click.pocoo.org/459-.. _utilities for testing: http://click.pocoo.org/testing457+.. _click: https://click.palletsprojects.com/458+.. _utilities for testing: https://click.palletsprojects.com/testing/modified:docs/unicode.rst+3 added-3 removed
4 unmodified lines5 text. Not only these libraries, also the majority of web related Python6 libraries that deal with text. If you don't know Unicode so far, you7 should probably read `The Absolute Minimum Every Software Developer8 Absolutely, Positively Must Know About Unicode and Character Sets9-<https://www.joelonsoftware.com/articles/Unicode.html>`_. This part of the10-documentation just tries to cover the very basics so that you have a11-pleasant experience with Unicode related things.9+<https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/>`_.10+This part of the documentation just tries to cover the very basics so11+that you have a pleasant experience with Unicode related things.12 13 Automatic Conversion14 --------------------15 92 unmodified linesdeleted:scripts/make-release.py-164 removed
1-#!/usr/bin/env python2-from __future__ import print_function3-4-import os5-import re6-import sys7-from datetime import date8-from datetime import datetime9-from subprocess import PIPE10-from subprocess import Popen11-12-_date_strip_re = re.compile(r"(?<=\d)(st|nd|rd|th)")13-14-15-def parse_changelog():16- with open("CHANGES.rst") as f:17- lineiter = iter(f)18- for line in lineiter:19- match = re.search(r"^Version\s+(.*)", line.strip())20-21- if match is None:22- continue23-24- version = match.group(1).strip()25-26- if next(lineiter).count("-") != len(match.group(0)):27- continue28-29- while 1:30- change_info = next(lineiter).strip()31-32- if change_info:33- break34-35- match = re.search(36- r"released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?",37- change_info,38- flags=re.IGNORECASE,39- )40-41- if match is None:42- continue43-44- datestr, codename = match.groups()45- return version, parse_date(datestr), codename46-47-48-def bump_version(version):49- try:50- parts = [int(i) for i in version.split(".")]51- except ValueError:52- fail("Current version is not numeric")53-54- parts[-1] += 155- return ".".join(map(str, parts))56-57-58-def parse_date(string):59- string = _date_strip_re.sub("", string)60- return datetime.strptime(string, "%B %d %Y")61-62-63-def set_filename_version(filename, version_number, pattern):64- changed = []65-66- def inject_version(match):67- before, old, after = match.groups()68- changed.append(True)69- return before + version_number + after70-71- with open(filename) as f:72- contents = re.sub(73- r"^(\s*%s\s*=\s*')(.+?)(')" % pattern,74- inject_version,75- f.read(),76- flags=re.DOTALL | re.MULTILINE,77- )78-79- if not changed:80- fail("Could not find %s in %s", pattern, filename)81-82- with open(filename, "w") as f:83- f.write(contents)84-85-86-def set_init_version(version):87- info("Setting __init__.py version to %s", version)88- set_filename_version("flask/__init__.py", version, "__version__")89-90-91-def build():92- cmd = [sys.executable, "setup.py", "sdist", "bdist_wheel"]93- Popen(cmd).wait()94-95-96-def fail(message, *args):97- print("Error:", message % args, file=sys.stderr)98- sys.exit(1)99-100-101-def info(message, *args):102- print(message % args, file=sys.stderr)103-104-105-def get_git_tags():106- return set(Popen(["git", "tag"], stdout=PIPE).communicate()[0].splitlines())107-108-109-def git_is_clean():110- return Popen(["git", "diff", "--quiet"]).wait() == 0111-112-113-def make_git_commit(message, *args):114- message = message % args115- Popen(["git", "commit", "-am", message]).wait()116-117-118-def make_git_tag(tag):119- info('Tagging "%s"', tag)120- Popen(["git", "tag", tag]).wait()121-122-123-def main():124- os.chdir(os.path.join(os.path.dirname(__file__), ".."))125-126- rv = parse_changelog()127-128- if rv is None:129- fail("Could not parse changelog")130-131- version, release_date, codename = rv132- dev_version = bump_version(version) + ".dev"133-134- info(135- "Releasing %s (codename %s, release date %s)",136- version,137- codename,138- release_date.strftime("%d/%m/%Y"),139- )140- tags = get_git_tags()141-142- if version in tags:143- fail('Version "%s" is already tagged', version)144-145- if release_date.date() != date.today():146- fail("Release date is not today (%s != %s)", release_date.date(), date.today())147-148- if not git_is_clean():149- fail("You have uncommitted changes in git")150-151- try:152- import wheel # noqa: F401153- except ImportError:154- fail("You need to install the wheel package.")155-156- set_init_version(version)157- make_git_commit("Bump version number to %s", version)158- make_git_tag(version)159- build()160- set_init_version(dev_version)161-162-163-if __name__ == "__main__":164- main()modified:src/flask/json/__init__.py+2 added-2 removed
1 unmodified line2 """3 flask.json4 ~~~~~~~~~~5 6-:copyright: © 2010 by the Pallets team.7-:license: BSD, see LICENSE for more details.6+:copyright: 2010 Pallets7+:license: BSD-3-Clause8 """9 import codecs10 import io11 import uuid365 unmodified linesmodified:src/flask/json/tag.py+2 added-2 removed
36 unmodified lines37 return OrderedDict(value)38 39 app.session_interface.serializer.register(TagOrderedDict, index=0)40 41-:copyright: © 2010 by the Pallets team.42-:license: BSD, see LICENSE for more details.41+:copyright: 2010 Pallets42+:license: BSD-3-Clause43 """44 from base64 import b64decode45 from base64 import b64encode46 from datetime import datetime263 unmodified linesmodified:src/flask/__init__.py+3 added-3 removed
4 unmodified lines5 6 A microframework based on Werkzeug. It's extensively documented7 and follows best practice patterns.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 # utilities we import from Werkzeug and Jinja2 that are unused13 # in the module but are exported as public interface.14 from jinja2 import escape40 unmodified lines55 from .signals import template_rendered56 from .templating import render_template57 from .templating import render_template_string58 59-__version__ = "1.1.dev"59+__version__ = "1.1.0.dev"modified:src/flask/__main__.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~5 6 Alias for flask.run for the command line.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 12 if __name__ == "__main__":13 from .cli import main2 unmodified linesmodified:src/flask/_compat.py+2 added-2 removed
5 unmodified lines6 Some py2/py3 compatibility support based on a stripped down7 version of six so we don't have to depend on a specific version8 of it.9 10- :copyright: © 2010 by the Pallets team.11- :license: BSD, see LICENSE for more details.10+ :copyright: 2010 Pallets11+ :license: BSD-3-Clause12 """13 import sys14 15 PY2 = sys.version_info[0] == 2100 unmodified linesmodified:src/flask/app.py+9 added-3 removed
3 unmodified lines4 ~~~~~~~~~5 6 This module implements the central WSGI application object.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import os12 import sys13 import warnings1317 unmodified lines1331 return decorator1332 1333 @staticmethod1334 def _get_exc_class_and_code(exc_class_or_code):1335- """Ensure that we register only exceptions as handler keys"""1335+ """Get the exception class being handled. For HTTP status codes1336+ or ``HTTPException`` subclasses, return both the exception and1337+ status code.1338+1339+ :param exc_class_or_code: Any exception class, or an HTTP status1340+ code as an integer.1341+ """1342 if isinstance(exc_class_or_code, integer_types):1343 exc_class = default_exceptions[exc_class_or_code]1344 else:1345 exc_class = exc_class_or_code1117 unmodified linesmodified:src/flask/blueprints.py+45 added-7 removed
4 unmodified lines5 6 Blueprints are the recommended way to implement larger or more7 pluggable applications in Flask 0.7 and later.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 from functools import update_wrapper13 14 from .helpers import _endpoint_from_view_func72 unmodified lines87 )88 89 90 class Blueprint(_PackageBoundObject):91- """Represents a blueprint. A blueprint is an object that records92- functions that will be called with the93- :class:`~flask.blueprints.BlueprintSetupState` later to register functions94- or other things on the main application. See :ref:`blueprints` for more95- information.91+ """Represents a blueprint, a collection of routes and other92+ app-related functions that can be registered on a real application93+ later.94 95+ A blueprint is an object that allows defining application functions96+ without requiring an application object ahead of time. It uses the97+ same decorators as :class:`~flask.Flask`, but defers the need for an98+ application by recording them for later registration.99+100+ Decorating a function with a blueprint creates a deferred function101+ that is called with :class:`~flask.blueprints.BlueprintSetupState`102+ when the blueprint is registered on an application.103+104+ See :ref:`blueprints` for more information.105+106 .. versionchanged:: 1.1.0107 Blueprints have a ``cli`` group to register nested CLI commands.108 The ``cli_group`` parameter controls the name of the group under109 the ``flask`` command.110 111 .. versionadded:: 0.7112+113+ :param name: The name of the blueprint. Will be prepended to each114+ endpoint name.115+ :param import_name: The name of the blueprint package, usually116+ ``__name__``. This helps locate the ``root_path`` for the117+ blueprint.118+ :param static_folder: A folder with static files that should be119+ served by the blueprint's static route. The path is relative to120+ the blueprint's root path. Blueprint static files are disabled121+ by default.122+ :param static_url_path: The url to serve static files from.123+ Defaults to ``static_folder``. If the blueprint does not have124+ a ``url_prefix``, the app's static route will take precedence,125+ and the blueprint's static files won't be accessible.126+ :param template_folder: A folder with templates that should be added127+ to the app's template search path. The path is relative to the128+ blueprint's root path. Blueprint templates are disabled by129+ default. Blueprint templates have a lower precedence than those130+ in the app's templates folder.131+ :param url_prefix: A path to prepend to all of the blueprint's URLs,132+ to make them distinct from the rest of the app's routes.133+ :param subdomain: A subdomain that blueprint routes will match on by134+ default.135+ :param url_defaults: A dict of default values that blueprint routes136+ will receive by default.137+ :param root_path: By default, the blueprint will automatically this138+ based on ``import_name``. In certain situations this automatic139+ detection can fail, so the path can be specified manually140+ instead.141 """142 143 warn_on_modifications = False144 _got_registered_once = False425 unmodified linesmodified:src/flask/cli.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~5 6 A simple command line application to run flask apps.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 from __future__ import print_function12 13 import ast956 unmodified linesmodified:src/flask/config.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~5 6 Implements the configuration related objects.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import errno12 import os13 import types256 unmodified linesmodified:src/flask/ctx.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~5 6 Implements the objects required to keep the context.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import sys12 from functools import update_wrapper13 462 unmodified linesmodified:src/flask/debughelpers.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~~~5 6 Various helpers to make the development experience better.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import os12 from warnings import warn13 170 unmodified linesmodified:src/flask/globals.py+2 added-2 removed
4 unmodified lines5 6 Defines all the global objects that are proxies to the current7 active context.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 from functools import partial13 14 from werkzeug.local import LocalProxy48 unmodified linesmodified:src/flask/helpers.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~5 6 Implements various helpers.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import io12 import mimetypes13 import os1108 unmodified linesmodified:src/flask/logging.py+2 added-2 removed
1 unmodified line2 """3 flask.logging4 ~~~~~~~~~~~~~5 6-:copyright: © 2010 by the Pallets team.7-:license: BSD, see LICENSE for more details.6+:copyright: 2010 Pallets7+:license: BSD-3-Clause8 """9 from __future__ import absolute_import10 11 import logging66 unmodified linesmodified:src/flask/sessions.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~5 6 Implements cookie based sessions based on itsdangerous.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import hashlib12 import warnings13 from datetime import datetime375 unmodified linesmodified:src/flask/signals.py+2 added-2 removed
4 unmodified lines5 6 Implements signals based on blinker if available, otherwise7 falls silently back to a noop.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 try:13 from blinker import Namespace14 51 unmodified linesmodified:src/flask/templating.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~5 6 Implements the bridge to Jinja2.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 from jinja2 import BaseLoader12 from jinja2 import Environment as BaseEnvironment13 from jinja2 import TemplateNotFound142 unmodified linesmodified:src/flask/testing.py+2 added-2 removed
4 unmodified lines5 6 Implements test support helpers. This module is lazily imported7 and usually not used in production environments.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 import warnings13 from contextlib import contextmanager14 269 unmodified linesmodified:src/flask/views.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~5 6 This module provides class-based views inspired by the ones in Django.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 from ._compat import with_metaclass12 from .globals import request13 150 unmodified linesmodified:src/flask/wrappers.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~5 6 Implements the WSGI wrappers (request and response).7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 from werkzeug.exceptions import BadRequest12 from werkzeug.wrappers import Request as RequestBase13 from werkzeug.wrappers import Response as ResponseBase124 unmodified linesmodified:tests/conftest.py+2 added-2 removed
1 unmodified line2 """3 tests.conftest4 ~~~~~~~~~~~~~~5 6- :copyright: © 2010 by the Pallets team.7- :license: BSD, see LICENSE for more details.6+ :copyright: 2010 Pallets7+ :license: BSD-3-Clause8 """9 import os10 import pkgutil11 import sys191 unmodified linesmodified:tests/test_appctx.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~5 6 Tests the application context.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import pytest12 13 import flask207 unmodified linesmodified:tests/test_basic.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~~~~~~5 6 The basic functionality.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import re12 import sys13 import time1956 unmodified linesmodified:tests/test_blueprints.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~5 6 Blueprints (and currently modules)7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import functools12 13 import pytest850 unmodified linesmodified:tests/test_cli.py+2 added-2 removed
1 unmodified line2 """3 tests.test_cli4 ~~~~~~~~~~~~~~5 6- :copyright: © 2010 by the Pallets team.7- :license: BSD, see LICENSE for more details.6+ :copyright: 2010 Pallets7+ :license: BSD-3-Clause8 """9 # This file was part of Flask-CLI and was modified under the terms of10 # its Revised BSD License. Copyright © 2015 CERN.11 from __future__ import absolute_import656 unmodified linesmodified:tests/test_config.py+2 added-2 removed
1 unmodified line2 """3 tests.test_config4 ~~~~~~~~~~~~~~~~~5 6- :copyright: © 2010 by the Pallets team.7- :license: BSD, see LICENSE for more details.6+ :copyright: 2010 Pallets7+ :license: BSD-3-Clause8 """9 import os10 import textwrap11 from datetime import timedelta191 unmodified linesmodified:tests/test_helpers.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~~~~~~~~5 6 Various helpers.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import datetime12 import io13 import os1029 unmodified linesmodified:tests/test_instance_config.py+2 added-2 removed
1 unmodified line2 """3 tests.test_instance4 ~~~~~~~~~~~~~~~~~~~5 6- :copyright: © 2010 by the Pallets team.7- :license: BSD, see LICENSE for more details.6+ :copyright: 2010 Pallets7+ :license: BSD-3-Clause8 """9 import os10 import sys11 132 unmodified linesmodified:tests/test_json_tag.py+2 added-2 removed
1 unmodified line2 """3 tests.test_json_tag4 ~~~~~~~~~~~~~~~~~~~5 6-:copyright: © 2010 by the Pallets team.7-:license: BSD, see LICENSE for more details.6+:copyright: 2010 Pallets7+:license: BSD-3-Clause8 """9 from datetime import datetime10 from uuid import uuid411 82 unmodified linesmodified:tests/test_logging.py+2 added-2 removed
1 unmodified line2 """3 tests.test_logging4 ~~~~~~~~~~~~~~~~~~~5 6-:copyright: © 2010 by the Pallets team.7-:license: BSD, see LICENSE for more details.6+:copyright: 2010 Pallets7+:license: BSD-3-Clause8 """9 import logging10 import sys11 95 unmodified linesmodified:tests/test_regression.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~~~~~~~~~~~5 6 Tests regressions.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import gc12 import sys13 import threading84 unmodified linesmodified:tests/test_reqctx.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~5 6 Tests the request context.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import pytest12 13 import flask272 unmodified linesmodified:tests/test_signals.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~~~~~~~~5 6 Signalling.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import pytest12 13 try:193 unmodified linesmodified:tests/test_subclassing.py+2 added-2 removed
4 unmodified lines5 6 Test that certain behavior of flask can be customized by7 subclasses.8 9- :copyright: © 2010 by the Pallets team.10- :license: BSD, see LICENSE for more details.9+ :copyright: 2010 Pallets10+ :license: BSD-3-Clause11 """12 import flask13 from flask._compat import StringIO14 17 unmodified linesmodified:tests/test_templating.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~~~~5 6 Template functionality7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import logging12 13 import pytest438 unmodified linesmodified:tests/test_testing.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~~~5 6 Test client and more.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import click12 import pytest13 import werkzeug434 unmodified linesmodified:tests/test_user_error_handler.py+2 added-2 removed
1 unmodified line2 """3 tests.test_user_error_handler4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~5 6-:copyright: © 2010 by the Pallets team.7-:license: BSD, see LICENSE for more details.6+:copyright: 2010 Pallets7+:license: BSD-3-Clause8 """9 import pytest10 from werkzeug.exceptions import Forbidden11 from werkzeug.exceptions import HTTPException278 unmodified linesmodified:tests/test_views.py+2 added-2 removed
3 unmodified lines4 ~~~~~~~~~~~5 6 Pluggable views.7 8- :copyright: © 2010 by the Pallets team.9- :license: BSD, see LICENSE for more details.8+ :copyright: 2010 Pallets9+ :license: BSD-3-Clause10 """11 import pytest12 from werkzeug.http import parse_set_header13 239 unmodified linesdeleted:AUTHORS-12 removed
1-Flask is developed and maintained by the Pallets team and community2-contributors. It was created by Armin Ronacher. The core maintainers3-are:4-5-- David Lord (davidism)6-- Adrian Mönnich (ThiefMaster)7-- Armin Ronacher (mitsuhiko)8-- Marcus Unterwaditzer (untitaker)9-10-A full list of contributors is available from git with::11-12- git shortlog -snemodified:CHANGES.rst+604 added-674 removed
1 .. currentmodule:: flask2 3-Flask Changelog4-===============5-6-3 Version 1.1.04 -------------5 6 Unreleased12 unmodified lines19 exceptions even if there is no ``500`` error handler.20 21 - :meth:`flask.RequestContext.copy` includes the current session22 object in the request context copy. This prevents ``session``27- pointing to an out-of-date object. (`#2935`_)23+ pointing to an out-of-date object. :issue:`2935`24 - Using built-in RequestContext, unprintable Unicode characters in25 Host header will result in a HTTP 400 response and not HTTP 500 as30- previously. (`#2994`_)26+ previously. :pr:`2994`27 - :func:`send_file` supports :class:`~os.PathLike` objects as28 described in PEP 0519, to support :mod:`pathlib` in Python 3.33- (`#3059`_)29+ :pr:`3059`30 - :func:`send_file` supports :class:`~io.BytesIO` partial content.35- (`#2957`_)31+ :issue:`2957`32 - :func:`open_resource` accepts the "rt" file mode. This still does33 the same thing as "r". :issue:`3163`34 - The :attr:`MethodView.methods` attribute set in a base class is used35 by subclasses. :issue:`3138`46 unmodified lines82 than when it's created. This allows custom URL converters to access83 the app and request contexts, such as to query a database for an id.84 :issue:`3088`85 90-.. _#2935: https://github.com/pallets/flask/issues/293591-.. _#2957: https://github.com/pallets/flask/issues/295792-.. _#2994: https://github.com/pallets/flask/pull/299493-.. _#3059: https://github.com/pallets/flask/pull/305994-.. _#3179: https://github.com/pallets/flask/pull/317995-.. _#3125: https://github.com/pallets/flask/pull/312586 97-87 Version 1.0.388 -------------89 90 Released 2019-05-1791 92 - :func:`send_file` encodes filenames as ASCII instead of Latin-193 (ISO-8859-1). This fixes compatibility with Gunicorn, which is105- stricter about header encodings than PEP 3333. (`#2766`_)94+ stricter about header encodings than PEP 3333. :issue:`2766`95 - Allow custom CLIs using ``FlaskGroup`` to set the debug flag without96 it always being overwritten based on environment variables.108- (`#2765`_)97+ :pr:`2765`98 - ``flask --version`` outputs Werkzeug's version and simplifies the110- Python version. (`#2825`_)99+ Python version. :pr:`2825`100 - :func:`send_file` handles an ``attachment_filename`` that is a112- native Python 2 string (bytes) with UTF-8 coded bytes. (`#2933`_)101+ native Python 2 string (bytes) with UTF-8 coded bytes. :issue:`2933`102 - A catch-all error handler registered for ``HTTPException`` will not103 handle ``RoutingException``, which is used internally during104 routing. This fixes the unexpected behavior that had been introduced116- in 1.0. (`#2986`_)105+ in 1.0. :pr:`2986`106 - Passing the ``json`` argument to ``app.test_client`` does not118- push/pop an extra app context. (`#2900`_)107+ push/pop an extra app context. :issue:`2900`108 120-.. _#2766: https://github.com/pallets/flask/issues/2766121-.. _#2765: https://github.com/pallets/flask/pull/2765122-.. _#2825: https://github.com/pallets/flask/pull/2825123-.. _#2900: https://github.com/pallets/flask/issues/2900124-.. _#2933: https://github.com/pallets/flask/issues/2933125-.. _#2986: https://github.com/pallets/flask/pull/2986109 110 Version 1.0.2111 -------------112 113 Released 2018-05-02114 115 - Fix more backwards compatibility issues with merging slashes between133- a blueprint prefix and route. (`#2748`_)116+ a blueprint prefix and route. :pr:`2748`117 - Fix error with ``flask routes`` command when there are no routes.135- (`#2751`_)118+ :issue:`2751`119 137-.. _#2748: https://github.com/pallets/flask/pull/2748138-.. _#2751: https://github.com/pallets/flask/issues/2751120 140-121 Version 1.0.1122 -------------123 124 Released 2018-04-29125 126 - Fix registering partials (with no ``__name__``) as view functions.147- (`#2730`_)127+ :pr:`2730`128 - Don't treat lists returned from view functions the same as tuples.149- Only tuples are interpreted as response data. (`#2736`_)129+ Only tuples are interpreted as response data. :issue:`2736`130 - Extra slashes between a blueprint's ``url_prefix`` and a route URL131 are merged. This fixes some backwards compatibility issues with the152- change in 1.0. (`#2731`_, `#2742`_)132+ change in 1.0. :issue:`2731`, :issue:`2742`133 - Only trap ``BadRequestKeyError`` errors in debug mode, not all134 ``BadRequest`` errors. This allows ``abort(400)`` to continue155- working as expected. (`#2735`_)135+ working as expected. :issue:`2735`136 - The ``FLASK_SKIP_DOTENV`` environment variable can be set to ``1``157- to skip automatically loading dotenv files. (`#2722`_)137+ to skip automatically loading dotenv files. :issue:`2722`138 159-.. _#2722: https://github.com/pallets/flask/issues/2722160-.. _#2730: https://github.com/pallets/flask/pull/2730161-.. _#2731: https://github.com/pallets/flask/issues/2731162-.. _#2735: https://github.com/pallets/flask/issues/2735163-.. _#2736: https://github.com/pallets/flask/issues/2736164-.. _#2742: https://github.com/pallets/flask/issues/2742139 166-140 Version 1.0141 -----------142 143 Released 2018-04-26144 172-- **Python 2.6 and 3.3 are no longer supported.** (`pallets/meta#24`_)145+- Python 2.6 and 3.3 are no longer supported.146 - Bump minimum dependency versions to the latest stable versions:147 Werkzeug >= 0.14, Jinja >= 2.10, itsdangerous >= 0.24, Click >= 5.1.175- (`#2586`_)148+ :issue:`2586`149 - Skip :meth:`app.run <Flask.run>` when a Flask application is run150 from the command line. This avoids some behavior that was confusing151 to debug.152 - Change the default for :data:`JSONIFY_PRETTYPRINT_REGULAR` to153 ``False``. :func:`~json.jsonify` returns a compact format by181- default, and an indented format in debug mode. (`#2193`_)154+ default, and an indented format in debug mode. :pr:`2193`155 - :meth:`Flask.__init__ <Flask>` accepts the ``host_matching``183- argument and sets it on :attr:`~Flask.url_map`. (`#1559`_)156+ argument and sets it on :attr:`~Flask.url_map`. :issue:`1559`157 - :meth:`Flask.__init__ <Flask>` accepts the ``static_host`` argument158 and passes it as the ``host`` argument when defining the static186- route. (`#1559`_)159+ route. :issue:`1559`160 - :func:`send_file` supports Unicode in ``attachment_filename``.188- (`#2223`_)161+ :pr:`2223`162 - Pass ``_scheme`` argument from :func:`url_for` to190- :meth:`~Flask.handle_url_build_error`. (`#2017`_)163+ :meth:`~Flask.handle_url_build_error`. :pr:`2017`164 - :meth:`~Flask.add_url_rule` accepts the165 ``provide_automatic_options`` argument to disable adding the193- ``OPTIONS`` method. (`#1489`_)166+ ``OPTIONS`` method. :pr:`1489`167 - :class:`~views.MethodView` subclasses inherit method handlers from195- base classes. (`#1936`_)168+ base classes. :pr:`1936`169 - Errors caused while opening the session at the beginning of the197- request are handled by the app's error handlers. (`#2254`_)170+ request are handled by the app's error handlers. :pr:`2254`171 - Blueprints gained :attr:`~Blueprint.json_encoder` and172 :attr:`~Blueprint.json_decoder` attributes to override the app's200- encoder and decoder. (`#1898`_)173+ encoder and decoder. :pr:`1898`174 - :meth:`Flask.make_response` raises ``TypeError`` instead of175 ``ValueError`` for bad response types. The error messages have been203- improved to describe why the type is invalid. (`#2256`_)176+ improved to describe why the type is invalid. :pr:`2256`177 - Add ``routes`` CLI command to output routes registered on the205- application. (`#2259`_)178+ application. :pr:`2259`179 - Show warning when session cookie domain is a bare hostname or an IP180 address, as these may not behave properly in some browsers, such as208- Chrome. (`#2282`_)209-- Allow IP address as exact session cookie domain. (`#2282`_)181+ Chrome. :pr:`2282`182+- Allow IP address as exact session cookie domain. :pr:`2282`183 - ``SESSION_COOKIE_DOMAIN`` is set if it is detected through211- ``SERVER_NAME``. (`#2282`_)184+ ``SERVER_NAME``. :pr:`2282`185 - Auto-detect zero-argument app factory called ``create_app`` or213- ``make_app`` from ``FLASK_APP``. (`#2297`_)186+ ``make_app`` from ``FLASK_APP``. :pr:`2297`187 - Factory functions are not required to take a ``script_info``188 parameter to work with the ``flask`` command. If they take a single189 parameter or a parameter named ``script_info``, the217- :class:`~cli.ScriptInfo` object will be passed. (`#2319`_)190+ :class:`~cli.ScriptInfo` object will be passed. :pr:`2319`191 - ``FLASK_APP`` can be set to an app factory, with arguments if192 needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.220- (`#2326`_)193+ :pr:`2326`194 - ``FLASK_APP`` can point to local packages that are not installed in195 editable mode, although ``pip install -e`` is still preferred.223- (`#2414`_)196+ :pr:`2414`197 - The :class:`~views.View` class attribute198 :attr:`~views.View.provide_automatic_options` is set in199 :meth:`~views.View.as_view`, to be detected by227- :meth:`~Flask.add_url_rule`. (`#2316`_)200+ :meth:`~Flask.add_url_rule`. :pr:`2316`201 - Error handling will try handlers registered for ``blueprint, code``,202 ``app, code``, ``blueprint, exception``, ``app, exception``.230- (`#2314`_)203+ :pr:`2314`204 - ``Cookie`` is added to the response's ``Vary`` header if the session232- is accessed at all during the request (and not deleted). (`#2288`_)205+ is accessed at all during the request (and not deleted). :pr:`2288`206 - :meth:`~Flask.test_request_context` accepts ``subdomain`` and207 ``url_scheme`` arguments for use when building the base URL.235- (`#1621`_)208+ :pr:`1621`209 - Set :data:`APPLICATION_ROOT` to ``'/'`` by default. This was already210 the implicit default when it was set to ``None``.211 - :data:`TRAP_BAD_REQUEST_ERRORS` is enabled by default in debug mode.212 ``BadRequestKeyError`` has a message with the bad key in debug mode240- instead of the generic bad request message. (`#2348`_)213+ instead of the generic bad request message. :pr:`2348`214 - Allow registering new tags with215 :class:`~json.tag.TaggedJSONSerializer` to support storing other243- types in the session cookie. (`#2352`_)216+ types in the session cookie. :pr:`2352`217 - Only open the session if the request has not been pushed onto the218 context stack yet. This allows :func:`~stream_with_context`219 generators to access the same session that the containing view uses.247- (`#2354`_)220+ :pr:`2354`221 - Add ``json`` keyword argument for the test client request methods.222 This will dump the given object as JSON and set the appropriate250- content type. (`#2358`_)223+ content type. :pr:`2358`224 - Extract JSON handling to a mixin applied to both the225 :class:`Request` and :class:`Response` classes. This adds the226 :meth:`~Response.is_json` and :meth:`~Response.get_json` methods to254- the response to make testing JSON response much easier. (`#2358`_)227+ the response to make testing JSON response much easier. :pr:`2358`228 - Removed error handler caching because it caused unexpected results229 for some exception inheritance hierarchies. Register handlers230 explicitly for each exception if you want to avoid traversing the258- MRO. (`#2362`_)259-- Fix incorrect JSON encoding of aware, non-UTC datetimes. (`#2374`_)231+ MRO. :pr:`2362`232+- Fix incorrect JSON encoding of aware, non-UTC datetimes. :pr:`2374`233 - Template auto reloading will honor debug mode even even if261- :attr:`~Flask.jinja_env` was already accessed. (`#2373`_)262-- The following old deprecated code was removed. (`#2385`_)234+ :attr:`~Flask.jinja_env` was already accessed. :pr:`2373`235+- The following old deprecated code was removed. :issue:`2385`236 237 - ``flask.ext`` - import extensions directly by their name instead238 of through the ``flask.ext`` namespace. For example,239 ``import flask.ext.sqlalchemy`` becomes9 unmodified lines249 instead.250 - ``Request.module`` - use :attr:`Request.blueprint` instead.251 252 - The :attr:`Request.json` property is no longer deprecated.280- (`#1421`_)281-- Support passing a :class:`~werkzeug.test.EnvironBuilder` or282- ``dict`` to :meth:`test_client.open <werkzeug.test.Client.open>`.283- (`#2412`_)253+ :issue:`1421`254+- Support passing a :class:`~werkzeug.test.EnvironBuilder` or ``dict``255+ to :meth:`test_client.open <werkzeug.test.Client.open>`. :pr:`2412`256 - The ``flask`` command and :meth:`Flask.run` will load environment257 variables from ``.env`` and ``.flaskenv`` files if python-dotenv is286- installed. (`#2416`_)258+ installed. :pr:`2416`259 - When passing a full URL to the test client, the scheme in the URL is288- used instead of :data:`PREFERRED_URL_SCHEME`. (`#2430`_)260+ used instead of :data:`PREFERRED_URL_SCHEME`. :pr:`2430`261 - :attr:`Flask.logger` has been simplified. ``LOGGER_NAME`` and262 ``LOGGER_HANDLER_POLICY`` config was removed. The logger is always263 named ``flask.app``. The level is only set on first access, it264 doesn't check :attr:`Flask.debug` each time. Only one format is265 used, not different ones depending on :attr:`Flask.debug`. No266 handlers are removed, and a handler is only added if no handlers are295- already configured. (`#2436`_)296-- Blueprint view function names may not contain dots. (`#2450`_)267+ already configured. :pr:`2436`268+- Blueprint view function names may not contain dots. :pr:`2450`269 - Fix a ``ValueError`` caused by invalid ``Range`` requests in some298- cases. (`#2526`_)299-- The development server uses threads by default. (`#2529`_)270+ cases. :issue:`2526`271+- The development server uses threads by default. :pr:`2529`272 - Loading config files with ``silent=True`` will ignore301- :data:`~errno.ENOTDIR` errors. (`#2581`_)273+ :data:`~errno.ENOTDIR` errors. :pr:`2581`274 - Pass ``--cert`` and ``--key`` options to ``flask run`` to run the303- development server over HTTPS. (`#2606`_)275+ development server over HTTPS. :pr:`2606`276 - Added :data:`SESSION_COOKIE_SAMESITE` to control the ``SameSite``305- attribute on the session cookie. (`#2607`_)277+ attribute on the session cookie. :pr:`2607`278 - Added :meth:`~flask.Flask.test_cli_runner` to create a Click runner307- that can invoke Flask CLI commands for testing. (`#2636`_)279+ that can invoke Flask CLI commands for testing. :pr:`2636`280 - Subdomain matching is disabled by default and setting281 :data:`SERVER_NAME` does not implicitly enable it. It can be enabled282 by passing ``subdomain_matching=True`` to the ``Flask`` constructor.311- (`#2635`_)283+ :pr:`2635`284 - A single trailing slash is stripped from the blueprint313- ``url_prefix`` when it is registered with the app. (`#2629`_)314-- :meth:`Request.get_json` doesn't cache the315- result if parsing fails when ``silent`` is true. (`#2651`_)285+ ``url_prefix`` when it is registered with the app. :pr:`2629`286+- :meth:`Request.get_json` doesn't cache the result if parsing fails287+ when ``silent`` is true. :issue:`2651`288 - :func:`Request.get_json` no longer accepts arbitrary encodings.289 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but318- Flask will autodetect UTF-8, -16, or -32. (`#2691`_)290+ Flask will autodetect UTF-8, -16, or -32. :pr:`2691`291 - Added :data:`MAX_COOKIE_SIZE` and :attr:`Response.max_cookie_size`292 to control when Werkzeug warns about large cookies that browsers may321- ignore. (`#2693`_)293+ ignore. :pr:`2693`294 - Updated documentation theme to make docs look better in small323- windows. (`#2709`_)295+ windows. :pr:`2709`296 - Rewrote the tutorial docs and example project to take a more297 structured approach to help new users avoid common pitfalls.326- (`#2676`_)298+ :pr:`2676`299 328-.. _pallets/meta#24: https://github.com/pallets/meta/issues/24329-.. _#1421: https://github.com/pallets/flask/issues/1421330-.. _#1489: https://github.com/pallets/flask/pull/1489331-.. _#1559: https://github.com/pallets/flask/issues/1559332-.. _#1621: https://github.com/pallets/flask/pull/1621333-.. _#1898: https://github.com/pallets/flask/pull/1898334-.. _#1936: https://github.com/pallets/flask/pull/1936335-.. _#2017: https://github.com/pallets/flask/pull/2017336-.. _#2193: https://github.com/pallets/flask/pull/2193337-.. _#2223: https://github.com/pallets/flask/pull/2223338-.. _#2254: https://github.com/pallets/flask/pull/2254339-.. _#2256: https://github.com/pallets/flask/pull/2256340-.. _#2259: https://github.com/pallets/flask/pull/2259341-.. _#2282: https://github.com/pallets/flask/pull/2282342-.. _#2288: https://github.com/pallets/flask/pull/2288343-.. _#2297: https://github.com/pallets/flask/pull/2297344-.. _#2314: https://github.com/pallets/flask/pull/2314345-.. _#2316: https://github.com/pallets/flask/pull/2316346-.. _#2319: https://github.com/pallets/flask/pull/2319347-.. _#2326: https://github.com/pallets/flask/pull/2326348-.. _#2348: https://github.com/pallets/flask/pull/2348349-.. _#2352: https://github.com/pallets/flask/pull/2352350-.. _#2354: https://github.com/pallets/flask/pull/2354351-.. _#2358: https://github.com/pallets/flask/pull/2358352-.. _#2362: https://github.com/pallets/flask/pull/2362353-.. _#2374: https://github.com/pallets/flask/pull/2374354-.. _#2373: https://github.com/pallets/flask/pull/2373355-.. _#2385: https://github.com/pallets/flask/issues/2385356-.. _#2412: https://github.com/pallets/flask/pull/2412357-.. _#2414: https://github.com/pallets/flask/pull/2414358-.. _#2416: https://github.com/pallets/flask/pull/2416359-.. _#2430: https://github.com/pallets/flask/pull/2430360-.. _#2436: https://github.com/pallets/flask/pull/2436361-.. _#2450: https://github.com/pallets/flask/pull/2450362-.. _#2526: https://github.com/pallets/flask/issues/2526363-.. _#2529: https://github.com/pallets/flask/pull/2529364-.. _#2586: https://github.com/pallets/flask/issues/2586365-.. _#2581: https://github.com/pallets/flask/pull/2581366-.. _#2606: https://github.com/pallets/flask/pull/2606367-.. _#2607: https://github.com/pallets/flask/pull/2607368-.. _#2636: https://github.com/pallets/flask/pull/2636369-.. _#2635: https://github.com/pallets/flask/pull/2635370-.. _#2629: https://github.com/pallets/flask/pull/2629371-.. _#2651: https://github.com/pallets/flask/issues/2651372-.. _#2676: https://github.com/pallets/flask/pull/2676373-.. _#2691: https://github.com/pallets/flask/pull/2691374-.. _#2693: https://github.com/pallets/flask/pull/2693375-.. _#2709: https://github.com/pallets/flask/pull/2709300 377-301 Version 0.12.4302 --------------303 381-Released on April 29 2018304+Released 2018-04-29305 383-- Repackage 0.12.3 to fix package layout issue. (`#2728`_)306+- Repackage 0.12.3 to fix package layout issue. :issue:`2728`307 385-.. _#2728: https://github.com/pallets/flask/issues/2728308 387-309 Version 0.12.3310 --------------311 391-Released on April 26th 2018312+Released 2018-04-26313 314 - :func:`Request.get_json` no longer accepts arbitrary encodings.315 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but395- Flask will autodetect UTF-8, -16, or -32. (`#2692`_)316+ Flask will autodetect UTF-8, -16, or -32. :issue:`2692`317 - Fix a Python warning about imports when using ``python -m flask``.397- (`#2666`_)318+ :issue:`2666`319 - Fix a ``ValueError`` caused by invalid ``Range`` requests in some320 cases.321 401-.. _#2666: https://github.com/pallets/flask/issues/2666402-.. _#2692: https://github.com/pallets/flask/issues/2692322 404-323 Version 0.12.2324 --------------325 408-Released on May 16 2017326+Released 2017-05-16327 410-- Fix a bug in `safe_join` on Windows.328+- Fix a bug in ``safe_join`` on Windows.329 330+331 Version 0.12.1332 --------------333 415-Bugfix release, released on March 31st 2017334+Released 2017-03-31335 417-- Prevent `flask run` from showing a NoAppException when an ImportError occurs418- within the imported application module.419-- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix420- ``#2118``.421-- Use the ``SERVER_NAME`` config if it is present as default values for422- ``app.run``. ``#2109``, ``#2152``423-- Call `ctx.auto_pop` with the exception object instead of `None`, in the424- event that a `BaseException` such as `KeyboardInterrupt` is raised in a425- request handler.336+- Prevent ``flask run`` from showing a ``NoAppException`` when an337+ ``ImportError`` occurs within the imported application module.338+- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3.339+ :issue:`2118`340+- Use the ``SERVER_NAME`` config if it is present as default values341+ for ``app.run``. :issue:`2109`, :pr:`2152`342+- Call ``ctx.auto_pop`` with the exception object instead of ``None``,343+ in the event that a ``BaseException`` such as ``KeyboardInterrupt``344+ is raised in a request handler.345 346+347 Version 0.12348 ------------349 430-Released on December 21st 2016, codename Punsch.350+Released 2016-12-21, codename Punsch351 432-- the cli command now responds to `--version`.433-- Mimetype guessing and ETag generation for file-like objects in ``send_file``434- has been removed, as per issue ``#104``. (`#1849`_)435-- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to436- ``application/octet-stream``. (`#1988`_)437-- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``438- (`#1730`_).439-- Revert a behavior change that made the dev server crash instead of returning440- an Internal Server Error (`#2006`_).441-- Correctly invoke response handlers for both regular request dispatching as442- well as error handlers.443-- Disable logger propagation by default for the app logger.444-- Add support for range requests in ``send_file``.445-- ``app.test_client`` includes preset default environment, which can now be446- directly set, instead of per ``client.get``.352+- The cli command now responds to ``--version``.353+- Mimetype guessing and ETag generation for file-like objects in354+ ``send_file`` has been removed. :issue:`104`, :pr`1849`355+- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall356+ back to ``application/octet-stream``. :pr:`1988`357+- Make ``flask.safe_join`` able to join multiple paths like358+ ``os.path.join`` :pr:`1730`359+- Revert a behavior change that made the dev server crash instead of360+ returning an Internal Server Error. :pr:`2006`361+- Correctly invoke response handlers for both regular request362+ dispatching as well as error handlers.363+- Disable logger propagation by default for the app logger.364+- Add support for range requests in ``send_file``.365+- ``app.test_client`` includes preset default environment, which can366+ now be directly set, instead of per ``client.get``.367+- Fix crash when running under PyPy3. :pr:`1814`368 448-.. _#1849: https://github.com/pallets/flask/pull/1849449-.. _#1988: https://github.com/pallets/flask/pull/1988450-.. _#1730: https://github.com/pallets/flask/pull/1730451-.. _#2006: https://github.com/pallets/flask/pull/2006369 453-Version 0.11.2454---------------455-456-Bugfix release, unreleased457-458-- Fix crash when running under PyPy3. (`#1814`_)459-460-.. _#1814: https://github.com/pallets/flask/pull/1814461-370 Version 0.11.1371 --------------372 465-Bugfix release, released on June 7th 2016.373+Released 2016-06-07374 467-- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from working. (`#1872`_)375+- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from376+ working. :pr:`1872`377 469-.. _#1872: https://github.com/pallets/flask/pull/1872378 379 Version 0.11380 ------------381 474-Released on May 29th 2016, codename Absinthe.382+Released 2016-05-29, codename Absinthe383 476-- Added support to serializing top-level arrays to :func:`flask.jsonify`. This477- introduces a security risk in ancient browsers. See478- :ref:`json-security` for details.479-- Added before_render_template signal.480-- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing481- additional keyword arguments to the constructor of482- :attr:`flask.Flask.test_client_class`.483-- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the484- set-cookie behavior. If set to ``True`` a permanent session will be485- refreshed each request and get their lifetime extended, if set to486- ``False`` it will only be modified if the session actually modifies.487- Non permanent sessions are not affected by this and will always488- expire if the browser window closes.489-- Made Flask support custom JSON mimetypes for incoming data.490-- Added support for returning tuples in the form ``(response, headers)``491- from a view function.492-- Added :meth:`flask.Config.from_json`.493-- Added :attr:`flask.Flask.config_class`.494-- Added :meth:`flask.Config.get_namespace`.495-- Templates are no longer automatically reloaded outside of debug mode. This496- can be configured with the new ``TEMPLATES_AUTO_RELOAD`` config key.497-- Added a workaround for a limitation in Python 3.3's namespace loader.498-- Added support for explicit root paths when using Python 3.3's namespace499- packages.500-- Added :command:`flask` and the ``flask.cli`` module to start the local501- debug server through the click CLI system. This is recommended over the old502- ``flask.run()`` method as it works faster and more reliable due to a503- different design and also replaces ``Flask-Script``.504-- Error handlers that match specific classes are now checked first,505- thereby allowing catching exceptions that are subclasses of HTTP506- exceptions (in ``werkzeug.exceptions``). This makes it possible507- for an extension author to create exceptions that will by default508- result in the HTTP error of their choosing, but may be caught with509- a custom error handler if desired.510-- Added :meth:`flask.Config.from_mapping`.511-- Flask will now log by default even if debug is disabled. The log format is512- now hardcoded but the default log handling can be disabled through the513- ``LOGGER_HANDLER_POLICY`` configuration key.514-- Removed deprecated module functionality.515-- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when enabled will516- instruct Flask to explain how it locates templates. This should help517- users debug when the wrong templates are loaded.518-- Enforce blueprint handling in the order they were registered for template519- loading.520-- Ported test suite to py.test.521-- Deprecated ``request.json`` in favour of ``request.get_json()``.522-- Add "pretty" and "compressed" separators definitions in jsonify() method.523- Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing524- unnecessary white space included by default after separators.525-- JSON responses are now terminated with a newline character, because it is a526- convention that UNIX text files end with a newline and some clients don't527- deal well when this newline is missing. See528- https://github.com/pallets/flask/pull/1262 -- this came up originally as a529- part of https://github.com/kennethreitz/httpbin/issues/168530-- The automatically provided ``OPTIONS`` method is now correctly disabled if531- the user registered an overriding rule with the lowercase-version532- ``options`` (issue ``#1288``).533-- ``flask.json.jsonify`` now supports the ``datetime.date`` type (`#1326`_).534-- Don't leak exception info of already catched exceptions to context teardown535- handlers (`#1393`_).536-- Allow custom Jinja environment subclasses (`#1422`_).537-- Updated extension dev guidelines.384+- Added support to serializing top-level arrays to385+ :func:`flask.jsonify`. This introduces a security risk in ancient386+ browsers. See :ref:`json-security` for details.387+- Added before_render_template signal.388+- Added ``**kwargs`` to :meth:`flask.Test.test_client` to support389+ passing additional keyword arguments to the constructor of390+ :attr:`flask.Flask.test_client_class`.391+- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the392+ set-cookie behavior. If set to ``True`` a permanent session will be393+ refreshed each request and get their lifetime extended, if set to394+ ``False`` it will only be modified if the session actually modifies.395+ Non permanent sessions are not affected by this and will always396+ expire if the browser window closes.397+- Made Flask support custom JSON mimetypes for incoming data.398+- Added support for returning tuples in the form ``(response,399+ headers)`` from a view function.400+- Added :meth:`flask.Config.from_json`.401+- Added :attr:`flask.Flask.config_class`.402+- Added :meth:`flask.Config.get_namespace`.403+- Templates are no longer automatically reloaded outside of debug404+ mode. This can be configured with the new ``TEMPLATES_AUTO_RELOAD``405+ config key.406+- Added a workaround for a limitation in Python 3.3's namespace407+ loader.408+- Added support for explicit root paths when using Python 3.3's409+ namespace packages.410+- Added :command:`flask` and the ``flask.cli`` module to start the411+ local debug server through the click CLI system. This is recommended412+ over the old ``flask.run()`` method as it works faster and more413+ reliable due to a different design and also replaces414+ ``Flask-Script``.415+- Error handlers that match specific classes are now checked first,416+ thereby allowing catching exceptions that are subclasses of HTTP417+ exceptions (in ``werkzeug.exceptions``). This makes it possible for418+ an extension author to create exceptions that will by default result419+ in the HTTP error of their choosing, but may be caught with a custom420+ error handler if desired.421+- Added :meth:`flask.Config.from_mapping`.422+- Flask will now log by default even if debug is disabled. The log423+ format is now hardcoded but the default log handling can be disabled424+ through the ``LOGGER_HANDLER_POLICY`` configuration key.425+- Removed deprecated module functionality.426+- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when427+ enabled will instruct Flask to explain how it locates templates.428+ This should help users debug when the wrong templates are loaded.429+- Enforce blueprint handling in the order they were registered for430+ template loading.431+- Ported test suite to py.test.432+- Deprecated ``request.json`` in favour of ``request.get_json()``.433+- Add "pretty" and "compressed" separators definitions in jsonify()434+ method. Reduces JSON response size when435+ ``JSONIFY_PRETTYPRINT_REGULAR=False`` by removing unnecessary white436+ space included by default after separators.437+- JSON responses are now terminated with a newline character, because438+ it is a convention that UNIX text files end with a newline and some439+ clients don't deal well when this newline is missing. This came up440+ originally as a part of441+ https://github.com/postmanlabs/httpbin/issues/168. :pr:`1262`442+- The automatically provided ``OPTIONS`` method is now correctly443+ disabled if the user registered an overriding rule with the444+ lowercase-version ``options``. :issue:`1288`445+- ``flask.json.jsonify`` now supports the ``datetime.date`` type.446+ :pr:`1326`447+- Don't leak exception info of already caught exceptions to context448+ teardown handlers. :pr:`1393`449+- Allow custom Jinja environment subclasses. :pr:`1422`450+- Updated extension dev guidelines.451+- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.452+- Turn on autoescape for ``flask.templating.render_template_string``453+ by default. :pr:`1515`454+- ``flask.ext`` is now deprecated. :pr:`1484`455+- ``send_from_directory`` now raises BadRequest if the filename is456+ invalid on the server OS. :pr:`1763`457+- Added the ``JSONIFY_MIMETYPE`` configuration variable. :pr:`1728`458+- Exceptions during teardown handling will no longer leave bad459+ application contexts lingering around.460+- Fixed broken ``test_appcontext_signals()`` test case.461+- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package`462+ with a useful message explaining why it is raised when a PEP 302463+ import hook is used without an ``is_package()`` method.464+- Fixed an issue causing exceptions raised before entering a request465+ or app context to be passed to teardown handlers.466+- Fixed an issue with query parameters getting removed from requests467+ in the test client when absolute URLs were requested.468+- Made ``@before_first_request`` into a decorator as intended.469+- Fixed an etags bug when sending a file streams with a name.470+- Fixed ``send_from_directory`` not expanding to the application root471+ path correctly.472+- Changed logic of before first request handlers to flip the flag473+ after invoking. This will allow some uses that are potentially474+ dangerous but should probably be permitted.475+- Fixed Python 3 bug when a handler from476+ ``app.url_build_error_handlers`` reraises the ``BuildError``.477 539-- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.540-- Turn on autoescape for ``flask.templating.render_template_string`` by default541- (`#1515`_).542-- ``flask.ext`` is now deprecated (`#1484`_).543-- ``send_from_directory`` now raises BadRequest if the filename is invalid on544- the server OS (`#1763`_).545-- Added the ``JSONIFY_MIMETYPE`` configuration variable (`#1728`_).546-- Exceptions during teardown handling will no longer leave bad application547- contexts lingering around.478 549-.. _#1326: https://github.com/pallets/flask/pull/1326550-.. _#1393: https://github.com/pallets/flask/pull/1393551-.. _#1422: https://github.com/pallets/flask/pull/1422552-.. _#1515: https://github.com/pallets/flask/pull/1515553-.. _#1484: https://github.com/pallets/flask/pull/1484554-.. _#1763: https://github.com/pallets/flask/pull/1763555-.. _#1728: https://github.com/pallets/flask/pull/1728556-557-Version 0.10.2558---------------559-560-(bugfix release, release date to be announced)561-562-- Fixed broken `test_appcontext_signals()` test case.563-- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a564- useful message explaining why it is raised when a PEP 302 import hook is used565- without an `is_package()` method.566-- Fixed an issue causing exceptions raised before entering a request or app567- context to be passed to teardown handlers.568-- Fixed an issue with query parameters getting removed from requests in569- the test client when absolute URLs were requested.570-- Made `@before_first_request` into a decorator as intended.571-- Fixed an etags bug when sending a file streams with a name.572-- Fixed `send_from_directory` not expanding to the application root path573- correctly.574-- Changed logic of before first request handlers to flip the flag after575- invoking. This will allow some uses that are potentially dangerous but576- should probably be permitted.577-- Fixed Python 3 bug when a handler from `app.url_build_error_handlers`578- reraises the `BuildError`.579-479 Version 0.10.1480 --------------481 583-(bugfix release, released on June 14th 2013)482+Released 2013-06-14483 585-- Fixed an issue where ``|tojson`` was not quoting single quotes which586- made the filter not work properly in HTML attributes. Now it's587- possible to use that filter in single quoted attributes. This should588- make using that filter with angular.js easier.589-- Added support for byte strings back to the session system. This broke590- compatibility with the common case of people putting binary data for591- token verification into the session.592-- Fixed an issue where registering the same method twice for the same endpoint593- would trigger an exception incorrectly.484+- Fixed an issue where ``|tojson`` was not quoting single quotes which485+ made the filter not work properly in HTML attributes. Now it's486+ possible to use that filter in single quoted attributes. This should487+ make using that filter with angular.js easier.488+- Added support for byte strings back to the session system. This489+ broke compatibility with the common case of people putting binary490+ data for token verification into the session.491+- Fixed an issue where registering the same method twice for the same492+ endpoint would trigger an exception incorrectly.493 494+495 Version 0.10496 ------------497 598-Released on June 13th 2013, codename Limoncello.498+Released 2013-06-13, codename Limoncello499 600-- Changed default cookie serialization format from pickle to JSON to601- limit the impact an attacker can do if the secret key leaks. See602- :ref:`upgrading-to-010` for more information.603-- Added ``template_test`` methods in addition to the already existing604- ``template_filter`` method family.605-- Added ``template_global`` methods in addition to the already existing606- ``template_filter`` method family.607-- Set the content-length header for x-sendfile.608-- ``tojson`` filter now does not escape script blocks in HTML5 parsers.609-- ``tojson`` used in templates is now safe by default due. This was610- allowed due to the different escaping behavior.611-- Flask will now raise an error if you attempt to register a new function612- on an already used endpoint.613-- Added wrapper module around simplejson and added default serialization614- of datetime objects. This allows much easier customization of how615- JSON is handled by Flask or any Flask extension.616-- Removed deprecated internal ``flask.session`` module alias. Use617- ``flask.sessions`` instead to get the session module. This is not to618- be confused with ``flask.session`` the session proxy.619-- Templates can now be rendered without request context. The behavior is620- slightly different as the ``request``, ``session`` and ``g`` objects621- will not be available and blueprint's context processors are not622- called.623-- The config object is now available to the template as a real global and624- not through a context processor which makes it available even in imported625- templates by default.626-- Added an option to generate non-ascii encoded JSON which should result627- in less bytes being transmitted over the network. It's disabled by628- default to not cause confusion with existing libraries that might expect629- ``flask.json.dumps`` to return bytestrings by default.630-- ``flask.g`` is now stored on the app context instead of the request631- context.632-- ``flask.g`` now gained a ``get()`` method for not erroring out on non633- existing items.634-- ``flask.g`` now can be used with the ``in`` operator to see what's defined635- and it now is iterable and will yield all attributes stored.636-- ``flask.Flask.request_globals_class`` got renamed to637- ``flask.Flask.app_ctx_globals_class`` which is a better name to what it638- does since 0.10.639-- `request`, `session` and `g` are now also added as proxies to the template640- context which makes them available in imported templates. One has to be641- very careful with those though because usage outside of macros might642- cause caching.643-- Flask will no longer invoke the wrong error handlers if a proxy644- exception is passed through.645-- Added a workaround for chrome's cookies in localhost not working646- as intended with domain names.647-- Changed logic for picking defaults for cookie values from sessions648- to work better with Google Chrome.649-- Added `message_flashed` signal that simplifies flashing testing.650-- Added support for copying of request contexts for better working with651- greenlets.652-- Removed custom JSON HTTP exception subclasses. If you were relying on them653- you can reintroduce them again yourself trivially. Using them however is654- strongly discouraged as the interface was flawed.655-- Python requirements changed: requiring Python 2.6 or 2.7 now to prepare656- for Python 3.3 port.657-- Changed how the teardown system is informed about exceptions. This is now658- more reliable in case something handles an exception halfway through659- the error handling process.660-- Request context preservation in debug mode now keeps the exception661- information around which means that teardown handlers are able to662- distinguish error from success cases.663-- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.664-- Flask now orders JSON keys by default to not trash HTTP caches due to665- different hash seeds between different workers.666-- Added `appcontext_pushed` and `appcontext_popped` signals.667-- The builtin run method now takes the ``SERVER_NAME`` into account when668- picking the default port to run on.669-- Added `flask.request.get_json()` as a replacement for the old670- `flask.request.json` property.500+- Changed default cookie serialization format from pickle to JSON to501+ limit the impact an attacker can do if the secret key leaks. See502+ :ref:`upgrading-to-010` for more information.503+- Added ``template_test`` methods in addition to the already existing504+ ``template_filter`` method family.505+- Added ``template_global`` methods in addition to the already506+ existing ``template_filter`` method family.507+- Set the content-length header for x-sendfile.508+- ``tojson`` filter now does not escape script blocks in HTML5509+ parsers.510+- ``tojson`` used in templates is now safe by default due. This was511+ allowed due to the different escaping behavior.512+- Flask will now raise an error if you attempt to register a new513+ function on an already used endpoint.514+- Added wrapper module around simplejson and added default515+ serialization of datetime objects. This allows much easier516+ customization of how JSON is handled by Flask or any Flask517+ extension.518+- Removed deprecated internal ``flask.session`` module alias. Use519+ ``flask.sessions`` instead to get the session module. This is not to520+ be confused with ``flask.session`` the session proxy.521+- Templates can now be rendered without request context. The behavior522+ is slightly different as the ``request``, ``session`` and ``g``523+ objects will not be available and blueprint's context processors are524+ not called.525+- The config object is now available to the template as a real global526+ and not through a context processor which makes it available even in527+ imported templates by default.528+- Added an option to generate non-ascii encoded JSON which should529+ result in less bytes being transmitted over the network. It's530+ disabled by default to not cause confusion with existing libraries531+ that might expect ``flask.json.dumps`` to return bytestrings by532+ default.533+- ``flask.g`` is now stored on the app context instead of the request534+ context.535+- ``flask.g`` now gained a ``get()`` method for not erroring out on536+ non existing items.537+- ``flask.g`` now can be used with the ``in`` operator to see what's538+ defined and it now is iterable and will yield all attributes stored.539+- ``flask.Flask.request_globals_class`` got renamed to540+ ``flask.Flask.app_ctx_globals_class`` which is a better name to what541+ it does since 0.10.542+- ``request``, ``session`` and ``g`` are now also added as proxies to543+ the template context which makes them available in imported544+ templates. One has to be very careful with those though because545+ usage outside of macros might cause caching.546+- Flask will no longer invoke the wrong error handlers if a proxy547+ exception is passed through.548+- Added a workaround for chrome's cookies in localhost not working as549+ intended with domain names.550+- Changed logic for picking defaults for cookie values from sessions551+ to work better with Google Chrome.552+- Added ``message_flashed`` signal that simplifies flashing testing.553+- Added support for copying of request contexts for better working554+ with greenlets.555+- Removed custom JSON HTTP exception subclasses. If you were relying556+ on them you can reintroduce them again yourself trivially. Using557+ them however is strongly discouraged as the interface was flawed.558+- Python requirements changed: requiring Python 2.6 or 2.7 now to559+ prepare for Python 3.3 port.560+- Changed how the teardown system is informed about exceptions. This561+ is now more reliable in case something handles an exception halfway562+ through the error handling process.563+- Request context preservation in debug mode now keeps the exception564+ information around which means that teardown handlers are able to565+ distinguish error from success cases.566+- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.567+- Flask now orders JSON keys by default to not trash HTTP caches due568+ to different hash seeds between different workers.569+- Added ``appcontext_pushed`` and ``appcontext_popped`` signals.570+- The builtin run method now takes the ``SERVER_NAME`` into account571+ when picking the default port to run on.572+- Added ``flask.request.get_json()`` as a replacement for the old573+ ``flask.request.json`` property.574 575+576 Version 0.9577 -----------578 675-Released on July 1st 2012, codename Campari.579+Released 2012-07-01, codename Campari580 677-- The :func:`flask.Request.on_json_loading_failed` now returns a JSON formatted678- response by default.679-- The :func:`flask.url_for` function now can generate anchors to the680- generated links.681-- The :func:`flask.url_for` function now can also explicitly generate682- URL rules specific to a given HTTP method.683-- Logger now only returns the debug log setting if it was not set684- explicitly.685-- Unregister a circular dependency between the WSGI environment and686- the request object when shutting down the request. This means that687- environ ``werkzeug.request`` will be ``None`` after the response was688- returned to the WSGI server but has the advantage that the garbage689- collector is not needed on CPython to tear down the request unless690- the user created circular dependencies themselves.691-- Session is now stored after callbacks so that if the session payload692- is stored in the session you can still modify it in an after693- request callback.694-- The :class:`flask.Flask` class will avoid importing the provided import name695- if it can (the required first parameter), to benefit tools which build Flask696- instances programmatically. The Flask class will fall back to using import697- on systems with custom module hooks, e.g. Google App Engine, or when the698- import name is inside a zip archive (usually a .egg) prior to Python 2.7.699-- Blueprints now have a decorator to add custom template filters application700- wide, :meth:`flask.Blueprint.app_template_filter`.701-- The Flask and Blueprint classes now have a non-decorator method for adding702- custom template filters application wide,703- :meth:`flask.Flask.add_template_filter` and704- :meth:`flask.Blueprint.add_app_template_filter`.705-- The :func:`flask.get_flashed_messages` function now allows rendering flashed706- message categories in separate blocks, through a ``category_filter``707- argument.708-- The :meth:`flask.Flask.run` method now accepts ``None`` for `host` and `port`709- arguments, using default values when ``None``. This allows for calling run710- using configuration values, e.g. ``app.run(app.config.get('MYHOST'),711- app.config.get('MYPORT'))``, with proper behavior whether or not a config712- file is provided.713-- The :meth:`flask.render_template` method now accepts a either an iterable of714- template names or a single template name. Previously, it only accepted a715- single template name. On an iterable, the first template found is rendered.716-- Added :meth:`flask.Flask.app_context` which works very similar to the717- request context but only provides access to the current application. This718- also adds support for URL generation without an active request context.719-- View functions can now return a tuple with the first instance being an720- instance of :class:`flask.Response`. This allows for returning721- ``jsonify(error="error msg"), 400`` from a view function.722-- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a723- :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to override724- behavior of serving static files from Flask when using725- :meth:`flask.Flask.send_static_file` (used for the default static file726- handler) and :func:`~flask.helpers.send_file`. This hook is provided a727- filename, which for example allows changing cache controls by file extension.728- The default max-age for `send_file` and static files can be configured729- through a new ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is730- used in the default `get_send_file_max_age` implementation.731-- Fixed an assumption in sessions implementation which could break message732- flashing on sessions implementations which use external storage.733-- Changed the behavior of tuple return values from functions. They are no734- longer arguments to the response object, they now have a defined meaning.735-- Added :attr:`flask.Flask.request_globals_class` to allow a specific class to736- be used on creation of the :data:`~flask.g` instance of each request.737-- Added `required_methods` attribute to view functions to force-add methods738- on registration.739-- Added :func:`flask.after_this_request`.740-- Added :func:`flask.stream_with_context` and the ability to push contexts741- multiple times without producing unexpected behavior.581+- The :func:`flask.Request.on_json_loading_failed` now returns a JSON582+ formatted response by default.583+- The :func:`flask.url_for` function now can generate anchors to the584+ generated links.585+- The :func:`flask.url_for` function now can also explicitly generate586+ URL rules specific to a given HTTP method.587+- Logger now only returns the debug log setting if it was not set588+ explicitly.589+- Unregister a circular dependency between the WSGI environment and590+ the request object when shutting down the request. This means that591+ environ ``werkzeug.request`` will be ``None`` after the response was592+ returned to the WSGI server but has the advantage that the garbage593+ collector is not needed on CPython to tear down the request unless594+ the user created circular dependencies themselves.595+- Session is now stored after callbacks so that if the session payload596+ is stored in the session you can still modify it in an after request597+ callback.598+- The :class:`flask.Flask` class will avoid importing the provided599+ import name if it can (the required first parameter), to benefit600+ tools which build Flask instances programmatically. The Flask class601+ will fall back to using import on systems with custom module hooks,602+ e.g. Google App Engine, or when the import name is inside a zip603+ archive (usually a .egg) prior to Python 2.7.604+- Blueprints now have a decorator to add custom template filters605+ application wide, :meth:`flask.Blueprint.app_template_filter`.606+- The Flask and Blueprint classes now have a non-decorator method for607+ adding custom template filters application wide,608+ :meth:`flask.Flask.add_template_filter` and609+ :meth:`flask.Blueprint.add_app_template_filter`.610+- The :func:`flask.get_flashed_messages` function now allows rendering611+ flashed message categories in separate blocks, through a612+ ``category_filter`` argument.613+- The :meth:`flask.Flask.run` method now accepts ``None`` for ``host``614+ and ``port`` arguments, using default values when ``None``. This615+ allows for calling run using configuration values, e.g.616+ ``app.run(app.config.get('MYHOST'), app.config.get('MYPORT'))``,617+ with proper behavior whether or not a config file is provided.618+- The :meth:`flask.render_template` method now accepts a either an619+ iterable of template names or a single template name. Previously, it620+ only accepted a single template name. On an iterable, the first621+ template found is rendered.622+- Added :meth:`flask.Flask.app_context` which works very similar to623+ the request context but only provides access to the current624+ application. This also adds support for URL generation without an625+ active request context.626+- View functions can now return a tuple with the first instance being627+ an instance of :class:`flask.Response`. This allows for returning628+ ``jsonify(error="error msg"), 400`` from a view function.629+- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a630+ :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to631+ override behavior of serving static files from Flask when using632+ :meth:`flask.Flask.send_static_file` (used for the default static633+ file handler) and :func:`~flask.helpers.send_file`. This hook is634+ provided a filename, which for example allows changing cache635+ controls by file extension. The default max-age for ``send_file``636+ and static files can be configured through a new637+ ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used638+ in the default ``get_send_file_max_age`` implementation.639+- Fixed an assumption in sessions implementation which could break640+ message flashing on sessions implementations which use external641+ storage.642+- Changed the behavior of tuple return values from functions. They are643+ no longer arguments to the response object, they now have a defined644+ meaning.645+- Added :attr:`flask.Flask.request_globals_class` to allow a specific646+ class to be used on creation of the :data:`~flask.g` instance of647+ each request.648+- Added ``required_methods`` attribute to view functions to force-add649+ methods on registration.650+- Added :func:`flask.after_this_request`.651+- Added :func:`flask.stream_with_context` and the ability to push652+ contexts multiple times without producing unexpected behavior.653 654+655 Version 0.8.1656 -------------657 746-Bugfix release, released on July 1st 2012658+Released 2012-07-01659 748-- Fixed an issue with the undocumented `flask.session` module to not749- work properly on Python 2.5. It should not be used but did cause750- some problems for package managers.660+- Fixed an issue with the undocumented ``flask.session`` module to not661+ work properly on Python 2.5. It should not be used but did cause662+ some problems for package managers.663 664+665 Version 0.8666 -----------667 755-Released on September 29th 2011, codename Rakija668+Released 2011-09-29, codename Rakija669 757-- Refactored session support into a session interface so that758- the implementation of the sessions can be changed without759- having to override the Flask class.760-- Empty session cookies are now deleted properly automatically.761-- View functions can now opt out of getting the automatic762- OPTIONS implementation.763-- HTTP exceptions and Bad Request errors can now be trapped so that they764- show up normally in the traceback.765-- Flask in debug mode is now detecting some common problems and tries to766- warn you about them.767-- Flask in debug mode will now complain with an assertion error if a view768- was attached after the first request was handled. This gives earlier769- feedback when users forget to import view code ahead of time.770-- Added the ability to register callbacks that are only triggered once at771- the beginning of the first request. (:meth:`Flask.before_first_request`)772-- Malformed JSON data will now trigger a bad request HTTP exception instead773- of a value error which usually would result in a 500 internal server774- error if not handled. This is a backwards incompatible change.775-- Applications now not only have a root path where the resources and modules776- are located but also an instance path which is the designated place to777- drop files that are modified at runtime (uploads etc.). Also this is778- conceptually only instance depending and outside version control so it's779- the perfect place to put configuration files etc. For more information780- see :ref:`instance-folders`.781-- Added the ``APPLICATION_ROOT`` configuration variable.782-- Implemented :meth:`~flask.testing.TestClient.session_transaction` to783- easily modify sessions from the test environment.784-- Refactored test client internally. The ``APPLICATION_ROOT`` configuration785- variable as well as ``SERVER_NAME`` are now properly used by the test client786- as defaults.787-- Added :attr:`flask.views.View.decorators` to support simpler decorating of788- pluggable (class-based) views.789-- Fixed an issue where the test client if used with the "with" statement did not790- trigger the execution of the teardown handlers.791-- Added finer control over the session cookie parameters.792-- HEAD requests to a method view now automatically dispatch to the `get`793- method if no handler was implemented.794-- Implemented the virtual :mod:`flask.ext` package to import extensions from.795-- The context preservation on exceptions is now an integral component of796- Flask itself and no longer of the test client. This cleaned up some797- internal logic and lowers the odds of runaway request contexts in unittests.670+- Refactored session support into a session interface so that the671+ implementation of the sessions can be changed without having to672+ override the Flask class.673+- Empty session cookies are now deleted properly automatically.674+- View functions can now opt out of getting the automatic OPTIONS675+ implementation.676+- HTTP exceptions and Bad Request errors can now be trapped so that677+ they show up normally in the traceback.678+- Flask in debug mode is now detecting some common problems and tries679+ to warn you about them.680+- Flask in debug mode will now complain with an assertion error if a681+ view was attached after the first request was handled. This gives682+ earlier feedback when users forget to import view code ahead of683+ time.684+- Added the ability to register callbacks that are only triggered once685+ at the beginning of the first request.686+ (:meth:`Flask.before_first_request`)687+- Malformed JSON data will now trigger a bad request HTTP exception688+ instead of a value error which usually would result in a 500689+ internal server error if not handled. This is a backwards690+ incompatible change.691+- Applications now not only have a root path where the resources and692+ modules are located but also an instance path which is the693+ designated place to drop files that are modified at runtime (uploads694+ etc.). Also this is conceptually only instance depending and outside695+ version control so it's the perfect place to put configuration files696+ etc. For more information see :ref:`instance-folders`.697+- Added the ``APPLICATION_ROOT`` configuration variable.698+- Implemented :meth:`~flask.testing.TestClient.session_transaction` to699+ easily modify sessions from the test environment.700+- Refactored test client internally. The ``APPLICATION_ROOT``701+ configuration variable as well as ``SERVER_NAME`` are now properly702+ used by the test client as defaults.703+- Added :attr:`flask.views.View.decorators` to support simpler704+ decorating of pluggable (class-based) views.705+- Fixed an issue where the test client if used with the "with"706+ statement did not trigger the execution of the teardown handlers.707+- Added finer control over the session cookie parameters.708+- HEAD requests to a method view now automatically dispatch to the709+ ``get`` method if no handler was implemented.710+- Implemented the virtual :mod:`flask.ext` package to import711+ extensions from.712+- The context preservation on exceptions is now an integral component713+ of Flask itself and no longer of the test client. This cleaned up714+ some internal logic and lowers the odds of runaway request contexts715+ in unittests.716+- Fixed the Jinja2 environment's ``list_templates`` method not717+ returning the correct names when blueprints or modules were718+ involved.719 799-Version 0.7.3800--------------720 802-Bugfix release, release date to be decided803-804-- Fixed the Jinja2 environment's list_templates method not returning the805- correct names when blueprints or modules were involved.806-721 Version 0.7.2722 -------------723 810-Bugfix release, released on July 6th 2011724+Released 2011-07-06725 812-- Fixed an issue with URL processors not properly working on813- blueprints.726+- Fixed an issue with URL processors not properly working on727+ blueprints.728 729+730 Version 0.7.1731 -------------732 818-Bugfix release, released on June 29th 2011733+Released 2011-06-29734 820-- Added missing future import that broke 2.5 compatibility.821-- Fixed an infinite redirect issue with blueprints.735+- Added missing future import that broke 2.5 compatibility.736+- Fixed an infinite redirect issue with blueprints.737 738+739 Version 0.7740 -----------741 826-Released on June 28th 2011, codename Grappa742+Released 2011-06-28, codename Grappa743 828-- Added :meth:`~flask.Flask.make_default_options_response`829- which can be used by subclasses to alter the default830- behavior for ``OPTIONS`` responses.831-- Unbound locals now raise a proper :exc:`RuntimeError` instead832- of an :exc:`AttributeError`.833-- Mimetype guessing and etag support based on file objects is now834- deprecated for :func:`flask.send_file` because it was unreliable.835- Pass filenames instead or attach your own etags and provide a836- proper mimetype by hand.837-- Static file handling for modules now requires the name of the838- static folder to be supplied explicitly. The previous autodetection839- was not reliable and caused issues on Google's App Engine. Until840- 1.0 the old behavior will continue to work but issue dependency841- warnings.842-- fixed a problem for Flask to run on jython.843-- added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be844- used to flip the setting of exception propagation which previously845- was linked to ``DEBUG`` alone and is now linked to either ``DEBUG`` or846- ``TESTING``.847-- Flask no longer internally depends on rules being added through the848- `add_url_rule` function and can now also accept regular werkzeug849- rules added to the url map.850-- Added an `endpoint` method to the flask application object which851- allows one to register a callback to an arbitrary endpoint with852- a decorator.853-- Use Last-Modified for static file sending instead of Date which854- was incorrectly introduced in 0.6.855-- Added `create_jinja_loader` to override the loader creation process.856-- Implemented a silent flag for `config.from_pyfile`.857-- Added `teardown_request` decorator, for functions that should run at the end858- of a request regardless of whether an exception occurred. Also the behavior859- for `after_request` was changed. It's now no longer executed when an exception860- is raised. See :ref:`upgrading-to-new-teardown-handling`861-- Implemented :func:`flask.has_request_context`862-- Deprecated `init_jinja_globals`. Override the863- :meth:`~flask.Flask.create_jinja_environment` method instead to864- achieve the same functionality.865-- Added :func:`flask.safe_join`866-- The automatic JSON request data unpacking now looks at the charset867- mimetype parameter.868-- Don't modify the session on :func:`flask.get_flashed_messages` if there869- are no messages in the session.870-- `before_request` handlers are now able to abort requests with errors.871-- it is not possible to define user exception handlers. That way you can872- provide custom error messages from a central hub for certain errors that873- might occur during request processing (for instance database connection874- errors, timeouts from remote resources etc.).875-- Blueprints can provide blueprint specific error handlers.876-- Implemented generic :ref:`views` (class-based views).744+- Added :meth:`~flask.Flask.make_default_options_response` which can745+ be used by subclasses to alter the default behavior for ``OPTIONS``746+ responses.747+- Unbound locals now raise a proper :exc:`RuntimeError` instead of an748+ :exc:`AttributeError`.749+- Mimetype guessing and etag support based on file objects is now750+ deprecated for :func:`flask.send_file` because it was unreliable.751+ Pass filenames instead or attach your own etags and provide a proper752+ mimetype by hand.753+- Static file handling for modules now requires the name of the static754+ folder to be supplied explicitly. The previous autodetection was not755+ reliable and caused issues on Google's App Engine. Until 1.0 the old756+ behavior will continue to work but issue dependency warnings.757+- Fixed a problem for Flask to run on jython.758+- Added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be759+ used to flip the setting of exception propagation which previously760+ was linked to ``DEBUG`` alone and is now linked to either ``DEBUG``761+ or ``TESTING``.762+- Flask no longer internally depends on rules being added through the763+ ``add_url_rule`` function and can now also accept regular werkzeug764+ rules added to the url map.765+- Added an ``endpoint`` method to the flask application object which766+ allows one to register a callback to an arbitrary endpoint with a767+ decorator.768+- Use Last-Modified for static file sending instead of Date which was769+ incorrectly introduced in 0.6.770+- Added ``create_jinja_loader`` to override the loader creation771+ process.772+- Implemented a silent flag for ``config.from_pyfile``.773+- Added ``teardown_request`` decorator, for functions that should run774+ at the end of a request regardless of whether an exception occurred.775+ Also the behavior for ``after_request`` was changed. It's now no776+ longer executed when an exception is raised. See777+ :ref:`upgrading-to-new-teardown-handling`778+- Implemented :func:`flask.has_request_context`779+- Deprecated ``init_jinja_globals``. Override the780+ :meth:`~flask.Flask.create_jinja_environment` method instead to781+ achieve the same functionality.782+- Added :func:`flask.safe_join`783+- The automatic JSON request data unpacking now looks at the charset784+ mimetype parameter.785+- Don't modify the session on :func:`flask.get_flashed_messages` if786+ there are no messages in the session.787+- ``before_request`` handlers are now able to abort requests with788+ errors.789+- It is not possible to define user exception handlers. That way you790+ can provide custom error messages from a central hub for certain791+ errors that might occur during request processing (for instance792+ database connection errors, timeouts from remote resources etc.).793+- Blueprints can provide blueprint specific error handlers.794+- Implemented generic :ref:`views` (class-based views).795 796+797 Version 0.6.1798 -------------799 881-Bugfix release, released on December 31st 2010800+Released 2010-12-31801 883-- Fixed an issue where the default ``OPTIONS`` response was884- not exposing all valid methods in the ``Allow`` header.885-- Jinja2 template loading syntax now allows "./" in front of886- a template load path. Previously this caused issues with887- module setups.888-- Fixed an issue where the subdomain setting for modules was889- ignored for the static folder.890-- Fixed a security problem that allowed clients to download arbitrary files891- if the host server was a windows based operating system and the client892- uses backslashes to escape the directory the files where exposed from.802+- Fixed an issue where the default ``OPTIONS`` response was not803+ exposing all valid methods in the ``Allow`` header.804+- Jinja2 template loading syntax now allows "./" in front of a805+ template load path. Previously this caused issues with module806+ setups.807+- Fixed an issue where the subdomain setting for modules was ignored808+ for the static folder.809+- Fixed a security problem that allowed clients to download arbitrary810+ files if the host server was a windows based operating system and811+ the client uses backslashes to escape the directory the files where812+ exposed from.813 814+815 Version 0.6816 -----------817 897-Released on July 27th 2010, codename Whisky818+Released 2010-07-27, codename Whisky819 899-- after request functions are now called in reverse order of900- registration.901-- OPTIONS is now automatically implemented by Flask unless the902- application explicitly adds 'OPTIONS' as method to the URL rule.903- In this case no automatic OPTIONS handling kicks in.904-- static rules are now even in place if there is no static folder905- for the module. This was implemented to aid GAE which will906- remove the static folder if it's part of a mapping in the .yml907- file.908-- the :attr:`~flask.Flask.config` is now available in the templates909- as `config`.910-- context processors will no longer override values passed directly911- to the render function.912-- added the ability to limit the incoming request data with the913- new ``MAX_CONTENT_LENGTH`` configuration value.914-- the endpoint for the :meth:`flask.Module.add_url_rule` method915- is now optional to be consistent with the function of the916- same name on the application object.917-- added a :func:`flask.make_response` function that simplifies918- creating response object instances in views.919-- added signalling support based on blinker. This feature is currently920- optional and supposed to be used by extensions and applications. If921- you want to use it, make sure to have `blinker`_ installed.922-- refactored the way URL adapters are created. This process is now923- fully customizable with the :meth:`~flask.Flask.create_url_adapter`924- method.925-- modules can now register for a subdomain instead of just an URL926- prefix. This makes it possible to bind a whole module to a927- configurable subdomain.820+- After request functions are now called in reverse order of821+ registration.822+- OPTIONS is now automatically implemented by Flask unless the823+ application explicitly adds 'OPTIONS' as method to the URL rule. In824+ this case no automatic OPTIONS handling kicks in.825+- Static rules are now even in place if there is no static folder for826+ the module. This was implemented to aid GAE which will remove the827+ static folder if it's part of a mapping in the .yml file.828+- The :attr:`~flask.Flask.config` is now available in the templates as829+ ``config``.830+- Context processors will no longer override values passed directly to831+ the render function.832+- Added the ability to limit the incoming request data with the new833+ ``MAX_CONTENT_LENGTH`` configuration value.834+- The endpoint for the :meth:`flask.Module.add_url_rule` method is now835+ optional to be consistent with the function of the same name on the836+ application object.837+- Added a :func:`flask.make_response` function that simplifies838+ creating response object instances in views.839+- Added signalling support based on blinker. This feature is currently840+ optional and supposed to be used by extensions and applications. If841+ you want to use it, make sure to have `blinker`_ installed.842+- Refactored the way URL adapters are created. This process is now843+ fully customizable with the :meth:`~flask.Flask.create_url_adapter`844+ method.845+- Modules can now register for a subdomain instead of just an URL846+ prefix. This makes it possible to bind a whole module to a847+ configurable subdomain.848 849 .. _blinker: https://pypi.org/project/blinker/850 851+852 Version 0.5.2853 -------------854 934-Bugfix Release, released on July 15th 2010855+Released 2010-07-15856 936-- fixed another issue with loading templates from directories when937- modules were used.857+- Fixed another issue with loading templates from directories when858+ modules were used.859 860+861 Version 0.5.1862 -------------863 942-Bugfix Release, released on July 6th 2010864+Released 2010-07-06865 944-- fixes an issue with template loading from directories when modules945- where used.866+- Fixes an issue with template loading from directories when modules867+ where used.868 869+870 Version 0.5871 -----------872 950-Released on July 6th 2010, codename Calvados873+Released 2010-07-06, codename Calvados874 952-- fixed a bug with subdomains that was caused by the inability to953- specify the server name. The server name can now be set with954- the ``SERVER_NAME`` config key. This key is now also used to set955- the session cookie cross-subdomain wide.956-- autoescaping is no longer active for all templates. Instead it957- is only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``.958- Inside templates this behavior can be changed with the959- ``autoescape`` tag.960-- refactored Flask internally. It now consists of more than a961- single file.962-- :func:`flask.send_file` now emits etags and has the ability to963- do conditional responses builtin.964-- (temporarily) dropped support for zipped applications. This was a965- rarely used feature and led to some confusing behavior.966-- added support for per-package template and static-file directories.967-- removed support for `create_jinja_loader` which is no longer used968- in 0.5 due to the improved module support.969-- added a helper function to expose files from any directory.875+- Fixed a bug with subdomains that was caused by the inability to876+ specify the server name. The server name can now be set with the877+ ``SERVER_NAME`` config key. This key is now also used to set the878+ session cookie cross-subdomain wide.879+- Autoescaping is no longer active for all templates. Instead it is880+ only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``. Inside881+ templates this behavior can be changed with the ``autoescape`` tag.882+- Refactored Flask internally. It now consists of more than a single883+ file.884+- :func:`flask.send_file` now emits etags and has the ability to do885+ conditional responses builtin.886+- (temporarily) dropped support for zipped applications. This was a887+ rarely used feature and led to some confusing behavior.888+- Added support for per-package template and static-file directories.889+- Removed support for ``create_jinja_loader`` which is no longer used890+ in 0.5 due to the improved module support.891+- Added a helper function to expose files from any directory.892 893+894 Version 0.4895 -----------896 974-Released on June 18th 2010, codename Rakia897+Released 2010-06-18, codename Rakia898 976-- added the ability to register application wide error handlers977- from modules.978-- :meth:`~flask.Flask.after_request` handlers are now also invoked979- if the request dies with an exception and an error handling page980- kicks in.981-- test client has the ability to preserve the request context982- for a little longer. This can also be used to trigger custom983- requests that do not pop the request stack for testing.984-- because the Python standard library caches loggers, the name of985- the logger is configurable now to better support unittests.986-- added ``TESTING`` switch that can activate unittesting helpers.987-- the logger switches to ``DEBUG`` mode now if debug is enabled.899+- Added the ability to register application wide error handlers from900+ modules.901+- :meth:`~flask.Flask.after_request` handlers are now also invoked if902+ the request dies with an exception and an error handling page kicks903+ in.904+- Test client has not the ability to preserve the request context for905+ a little longer. This can also be used to trigger custom requests906+ that do not pop the request stack for testing.907+- Because the Python standard library caches loggers, the name of the908+ logger is configurable now to better support unittests.909+- Added ``TESTING`` switch that can activate unittesting helpers.910+- The logger switches to ``DEBUG`` mode now if debug is enabled.911 912+913 Version 0.3.1914 -------------915 992-Bugfix release, released on May 28th 2010916+Released 2010-05-28917 994-- fixed a error reporting bug with :meth:`flask.Config.from_envvar`995-- removed some unused code from flask996-- release does no longer include development leftover files (.git997- folder for themes, built documentation in zip and pdf file and998- some .pyc files)918+- Fixed a error reporting bug with :meth:`flask.Config.from_envvar`919+- Removed some unused code from flask920+- Release does no longer include development leftover files (.git921+ folder for themes, built documentation in zip and pdf file and some922+ .pyc files)923 924+925 Version 0.3926 -----------927 1003-Released on May 28th 2010, codename Schnaps928+Released 2010-05-28, codename Schnaps929 1005-- added support for categories for flashed messages.1006-- the application now configures a :class:`logging.Handler` and will1007- log request handling exceptions to that logger when not in debug1008- mode. This makes it possible to receive mails on server errors1009- for example.1010-- added support for context binding that does not require the use of1011- the with statement for playing in the console.1012-- the request context is now available within the with statement making1013- it possible to further push the request context or pop it.1014-- added support for configurations.930+- Added support for categories for flashed messages.931+- The application now configures a :class:`logging.Handler` and will932+ log request handling exceptions to that logger when not in debug933+ mode. This makes it possible to receive mails on server errors for934+ example.935+- Added support for context binding that does not require the use of936+ the with statement for playing in the console.937+- The request context is now available within the with statement938+ making it possible to further push the request context or pop it.939+- Added support for configurations.940 941+942 Version 0.2943 -----------944 1019-Released on May 12th 2010, codename Jägermeister945+Released 2010-05-12, codename Jägermeister946 1021-- various bugfixes1022-- integrated JSON support1023-- added :func:`~flask.get_template_attribute` helper function.1024-- :meth:`~flask.Flask.add_url_rule` can now also register a1025- view function.1026-- refactored internal request dispatching.1027-- server listens on 127.0.0.1 by default now to fix issues with chrome.1028-- added external URL support.1029-- added support for :func:`~flask.send_file`1030-- module support and internal request handling refactoring1031- to better support pluggable applications.1032-- sessions can be set to be permanent now on a per-session basis.1033-- better error reporting on missing secret keys.1034-- added support for Google Appengine.947+- Various bugfixes948+- Integrated JSON support949+- Added :func:`~flask.get_template_attribute` helper function.950+- :meth:`~flask.Flask.add_url_rule` can now also register a view951+ function.952+- Refactored internal request dispatching.953+- Server listens on 127.0.0.1 by default now to fix issues with954+ chrome.955+- Added external URL support.956+- Added support for :func:`~flask.send_file`957+- Module support and internal request handling refactoring to better958+ support pluggable applications.959+- Sessions can be set to be permanent now on a per-session basis.960+- Better error reporting on missing secret keys.961+- Added support for Google Appengine.962 963+964 Version 0.1965 -----------966 967+Released 2010-04-16968+1039-First public preview release.969+- First public preview release.modified:CONTRIBUTING.rst+10 added-21 removed
7 unmodified lines8 9 Please, don't use the issue tracker for this. Use one of the following10 resources for questions about your own code:11 12-* The ``#get-help`` channel on our Discord chat: https://discord.gg/t6rrQZH12+* The ``#get-help`` channel on our Discord chat: https://discordapp.com/invite/t6rrQZH13 14 * The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but15 Discord is preferred.16 6 unmodified lines23 Reporting issues24 ----------------25 26 - Describe what you expected to happen.27-- If possible, include a `minimal, complete, and verifiable example`_ to help28- us identify the issue. This also helps check that the issue is not with your29- own code.27+- If possible, include a `minimal reproducible example`_ to help us28+ identify the issue. This also helps check that the issue is not with29+ your own code.30 - Describe what actually happened. Include the full traceback if there was an31 exception.32 - List your Python, Flask, and Werkzeug versions. If possible, check if this33 issue is already fixed in the repository.34 35-.. _minimal, complete, and verifiable example: https://stackoverflow.com/help/mcve35+.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example36 37 Submitting patches38 ------------------39 44 unmodified lines84 pre-commit install --install-hooks85 86 .. _GitHub account: https://github.com/join87 .. _latest version of git: https://git-scm.com/downloads88-.. _username: https://help.github.com/articles/setting-your-username-in-git/89-.. _email: https://help.github.com/articles/setting-your-email-in-git/88+.. _username: https://help.github.com/en/articles/setting-your-username-in-git89+.. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git90 .. _Fork: https://github.com/pallets/flask/fork91-.. _Clone: https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork91+.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork92 93 Start coding94 ~~~~~~~~~~~~95 20 unmodified lines116 .. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes117 .. _Black: https://black.readthedocs.io118 .. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html119 .. _pre-commit: https://pre-commit.com120-.. _create a pull request: https://help.github.com/articles/creating-a-pull-request/120+.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request121 122 .. _contributing-testsuite:123 124 Running the tests40 unmodified lines165 make html166 167 Open ``_build/html/index.html`` in your browser to view the docs.168 169-Read more about `Sphinx <https://www.sphinx-doc.org>`_.169+Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.170 171 172-make targets173-~~~~~~~~~~~~174-175-Flask provides a ``Makefile`` with various shortcuts. They will ensure that176-all dependencies are installed.177-178-- ``make test`` runs the basic test suite with ``pytest``179-- ``make cov`` runs the basic test suite with ``coverage``180-- ``make test-all`` runs the full test suite with ``tox``181-- ``make docs`` builds the HTML documentation182-172 Caution: zero-padded file modes173 -------------------------------174 175 This repository contains several zero-padded file modes that may cause issues18 unmodified linesdeleted:LICENSE-31 removed
1-Copyright © 2010 by the Pallets team.2-3-Some rights reserved.4-5-Redistribution and use in source and binary forms of the software as6-well as documentation, with or without modification, are permitted7-provided that the following conditions are met:8-9-* Redistributions of source code must retain the above copyright notice,10- this list of conditions and the following disclaimer.11-12-* Redistributions in binary form must reproduce the above copyright13- notice, this list of conditions and the following disclaimer in the14- documentation and/or other materials provided with the distribution.15-16-* Neither the name of the copyright holder nor the names of its17- contributors may be used to endorse or promote products derived from18- this software without specific prior written permission.19-20-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND21-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,22-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND23-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE24-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,25-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT26-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF27-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON28-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF30-THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF31-SUCH DAMAGE.added:LICENSE.rst+28 added
1+Copyright 2010 Pallets2+3+Redistribution and use in source and binary forms, with or without4+modification, are permitted provided that the following conditions are5+met:6+7+1. Redistributions of source code must retain the above copyright8+ notice, this list of conditions and the following disclaimer.9+10+2. Redistributions in binary form must reproduce the above copyright11+ notice, this list of conditions and the following disclaimer in the12+ documentation and/or other materials provided with the distribution.13+14+3. Neither the name of the copyright holder nor the names of its15+ contributors may be used to endorse or promote products derived from16+ this software without specific prior written permission.17+18+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.deleted:Makefile-32 removed
1-.PHONY: all install-dev test coverage cov test-all tox docs release clean-pyc upload-docs ebook2-3-all: test4-5-install-dev:6- pip install -q -e .[dev]7-8-test: clean-pyc install-dev9- pytest10-11-coverage: clean-pyc install-dev12- coverage run -m pytest13- coverage report14- coverage html15-16-cov: coverage17-18-test-all: install-dev19- tox20-21-tox: test-all22-23-docs: clean-pyc install-dev24- $(MAKE) -C docs html25-26-release:27- python scripts/make-release.py28-29-clean-pyc:30- find . -name '*.pyc' -exec rm -f {} +31- find . -name '*.pyo' -exec rm -f {} +32- find . -name '*~' -exec rm -f {} +modified:MANIFEST.in+5 added-8 removed
1-include Makefile CHANGES.rst CONTRIBUTING.rst LICENSE AUTHORS tox.ini2-1+include CHANGES.rst2+include CONTRIBUTING.rst3+include tox.ini4 graft artwork4-graft tests5-graft examples5 graft docs7-8-global-exclude *.py[co]9-6 prune docs/_build11-prune docs/_themes7+graft examples8+graft testsmodified:README.rst+2 added-4 removed
30 unmodified lines31 from flask import Flask32 33 app = Flask(__name__)34 35- @app.route('/')35+ @app.route("/")36 def hello():37- return 'Hello, World!'37+ return "Hello, World!"38 39 .. code-block:: text40 41 $ env FLASK_APP=hello.py flask run25 unmodified lines67 -----68 69 * Website: https://www.palletsprojects.com/p/flask/70 * Documentation: http://flask.pocoo.org/docs/71-* License: `BSD <https://github.com/pallets/flask/blob/master/LICENSE>`_71 * Releases: https://pypi.org/project/Flask/72 * Code: https://github.com/pallets/flask73 * Issue tracker: https://github.com/pallets/flask/issues74 * Test status: https://dev.azure.com/pallets/pallets/_build?definitionId=276-* Test coverage: https://codecov.io/gh/pallets/flask75 * Official chat: https://discord.gg/t6rrQZH76 77 .. _WSGI: https://wsgi.readthedocs.io78 .. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/2 unmodified linesmodified:setup.cfg+4 added-8 removed
1-[aliases]2-release = egg_info -Db ''1+[metadata]2+license_file = LICENSE.rst3 4 [bdist_wheel]5-universal = 15+universal = true6 7-[metadata]8-license_file = LICENSE9-7 [tool:pytest]11-minversion = 3.08 testpaths = tests9 10 [coverage:run]11 branch = True4 unmodified lines16 [coverage:paths]17 source =18 src/flask19 .tox/*/lib/python*/site-packages/flask24- .tox/pypy/site-packages/flask20+ .tox/*/site-packages/flask21 22 [flake8]23 # B = bugbear24 # E = pycodestyle errors21 unmodified linesmodified:setup.py+37 added-40 removed
1-#!/usr/bin/env python2-# -*- coding: utf-8 -*-1 import io2 import re5-from collections import OrderedDict3 4 from setuptools import find_packages5 from setuptools import setup6 7 with io.open("README.rst", "rt", encoding="utf8") as f:8 readme = f.read()9 10 with io.open("src/flask/__init__.py", "rt", encoding="utf8") as f:14- version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1)11+ version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)12 13 setup(14 name="Flask",15 version=version,19- url="https://www.palletsprojects.com/p/flask/",20- project_urls=OrderedDict(21- (22- ("Documentation", "http://flask.pocoo.org/docs/"),23- ("Code", "https://github.com/pallets/flask"),24- ("Issue tracker", "https://github.com/pallets/flask/issues"),25- )26- ),27- license="BSD",16+ url="https://palletsprojects.com/p/flask/",17+ project_urls={18+ "Documentation": "http://flask.palletsprojects.com/",19+ "Code": "https://github.com/pallets/flask",20+ "Issue tracker": "https://github.com/pallets/flask/issues",21+ },22+ license="BSD-3-Clause",23 author="Armin Ronacher",24 author_email="armin.ronacher@active-4.com",30- maintainer="Pallets team",25+ maintainer="Pallets",26 maintainer_email="contact@palletsprojects.com",27 description="A simple framework for building complex web applications.",28 long_description=readme,34- packages=find_packages("src"),35- package_dir={"": "src"},36- include_package_data=True,37- zip_safe=False,38- platforms="any",39- python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",40- install_requires=[41- "Werkzeug>=0.15",42- "Jinja2>=2.10.1",43- "itsdangerous>=0.24",44- "click>=5.1",45- ],46- extras_require={47- "dotenv": ["python-dotenv"],48- "dev": [49- "pytest>=3",50- "coverage",51- "tox",52- "sphinx",53- "pallets-sphinx-themes",54- "sphinxcontrib-log-cabinet",55- "pre-commit",56- ],57- "docs": ["sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet"],58- },29 classifiers=[30 "Development Status :: 5 - Production/Stable",31 "Environment :: Web Environment",32 "Framework :: Flask",3 unmodified lines36 "Programming Language :: Python",37 "Programming Language :: Python :: 2",38 "Programming Language :: Python :: 2.7",39 "Programming Language :: Python :: 3",70- "Programming Language :: Python :: 3.4",40 "Programming Language :: Python :: 3.5",41 "Programming Language :: Python :: 3.6",42 "Programming Language :: Python :: 3.7",43 "Topic :: Internet :: WWW/HTTP :: Dynamic Content",44 "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",45 "Topic :: Software Development :: Libraries :: Application Frameworks",46 "Topic :: Software Development :: Libraries :: Python Modules",47 ],48+ packages=find_packages("src"),49+ package_dir={"": "src"},50+ include_package_data=True,51+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",52+ install_requires=[53+ "Werkzeug>=0.15",54+ "Jinja2>=2.10.1",55+ "itsdangerous>=0.24",56+ "click>=5.1",57+ ],58+ extras_require={59+ "dotenv": ["python-dotenv"],60+ "dev": [61+ "pytest",62+ "coverage",63+ "tox",64+ "sphinx",65+ "pallets-sphinx-themes",66+ "sphinxcontrib-log-cabinet",67+ "sphinx-issues",68+ ],69+ "docs": [70+ "sphinx",71+ "pallets-sphinx-themes",72+ "sphinxcontrib-log-cabinet",73+ "sphinx-issues",74+ ],75+ },76 entry_points={"console_scripts": ["flask = flask.cli:main"]},77 )