Merge pull request #3270 from pallets/metadata
Before adoption: this commit came in with the history the project adopted, so no landing records it.
update project metadata
authored by David Lord · committed by GitHub · parents 6cd92eb, cb6272c · Browse files · 88 files·+983 added−1443 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
88 files+983 added−1443 removed
- tests:+36 added−36 removed
- other:+947 added−1407 removed
Provenance
- Commit
31d3c7e- Tree
83edd99- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
6cd92eb- Parent 2
cb6272c
88 files changed+983 added−1443 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.deleted:docs/_static/flask-favicon.icobinary
A binary file, deleted.
added:docs/_static/flask-icon.pngbinary
A binary file, added.
added:docs/_static/flask-logo.pngbinary
A binary file, added.
deleted:docs/_static/flask.pngbinary
A binary file, deleted.
deleted:docs/_static/logo-full.pngbinary
A binary file, deleted.
deleted:docs/_static/touch-icon.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
67 unmodified lines68 69 .. _nginx: https://nginx.org/70 .. _lighttpd: https://www.lighttpd.net/71 .. _cherokee: http://cherokee-project.com/72-.. _uwsgi: http://projects.unbit.it/uwsgi/72+.. _uwsgi: https://uwsgi-docs.readthedocs.io/en/latest/modified:docs/deploying/wsgi-standalone.rst+4 added-5 removed
41 unmodified lines42 Running `uWSGI HTTP Router`_::43 44 uwsgi --http 127.0.0.1:5000 --module myproject:app45 46-For a more optimized setup, see `configuring uWSGI and NGINX`_.46+For a more optimized setup, see :doc:`/deploying/uwsgi`.47 48-.. _uWSGI: http://uwsgi-docs.readthedocs.io/en/latest/49-.. _uWSGI HTTP Router: http://uwsgi-docs.readthedocs.io/en/latest/HTTP.html#the-uwsgi-http-https-router50-.. _configuring uWSGI and NGINX: uwsgi.html#starting-your-app-with-uwsgi48+.. _uWSGI: https://uwsgi-docs.readthedocs.io/en/latest/49+.. _uWSGI HTTP Router: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html#the-uwsgi-http-https-router50 51 Gevent52 -------53 30 unmodified lines84 application from ``myproject``::85 86 twistd -n web --port tcp:8080 --wsgi myproject.app87 89-.. _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+4 added-4 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__)24 unmodified lines92 To run such an application, you can use the :command:`flask` command::93 94 export FLASK_APP=myapp95 flask run96- 97-Flask will automatically detect the factory (``create_app`` or ``make_app``) 96+97+Flask will automatically detect the factory (``create_app`` or ``make_app``)98 in ``myapp``. You can also pass arguments to the factory like this::99 100 export FLASK_APP="myapp:create_app('dev')"101 flask run102- 102+103 Then the ``create_app`` factory in ``myapp`` is called with the string104 ``'dev'`` as the argument. See :doc:`/cli` for more detail.105 106 Factory Improvements11 unmodified linesmodified:docs/patterns/jquery.rst+2 added-2 removed
9 unmodified lines10 Python primitives (numbers, strings, dicts and lists) look like which is11 widely supported and very easy to parse. It became popular a few years12 ago and quickly replaced XML as transport format in web applications.13 14-.. _jQuery: http://jquery.com/14+.. _jQuery: https://jquery.com/15 16 Loading jQuery17 --------------18 7 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- <http://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
42 unmodified lines43 The :ref:`app-dispatch` chapter shows in detail how to apply middleware. You44 can introduce WSGI middleware to wrap your Flask instances and introduce fixes45 and changes at the layer between your Flask application and your HTTP46 server. Werkzeug includes several `middlewares47-<http://werkzeug.pocoo.org/docs/middlewares/>`_.47+<https://werkzeug.palletsprojects.com/middleware/>`_.48 49 Fork.50 -----51 50 unmodified linesmodified:docs/changelog.rst+3 added
1+Changelog2+=========3+4 .. include:: ../CHANGES.rstmodified:docs/cli.rst+3 added-3 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 ---------------------321 unmodified lines339 },340 )341 342 343-.. _entry point: https://packaging.python.org/tutorials/distributing-packages/#entry-points343+.. _entry point: https://packaging.python.org/tutorials/packaging-projects/#entry-points344 345 Inside :file:`flask_my_extension/commands.py` you can then export a Click346 object::347 60 unmodified lines408 409 The ``flask`` command, being separate from your code, does not have410 this issue and is recommended in most cases.411 412-.. _console script: https://packaging.python.org/tutorials/distributing-packages/#console-scripts412+.. _console script: https://packaging.python.org/tutorials/packaging-projects/#console-scripts413 414 415 PyCharm Integration416 -------------------50 unmodified linesmodified:docs/conf.py+10 added-19 removed
1-# -*- coding: utf-8 -*-2-from __future__ import print_function1+from pallets_sphinx_themes import get_version2+from pallets_sphinx_themes import ProjectLink3 4-from pallets_sphinx_themes import ProjectLink, get_version5-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 2 unmodified lines15 "sphinx.ext.autodoc",16 "sphinx.ext.intersphinx",17 "sphinxcontrib.log_cabinet",18 "pallets_sphinx_themes",19+ "sphinx_issues",20 ]21 intersphinx_mapping = {22 "python": ("https://docs.python.org/3/", None),24- "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),28 "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),29 "blinker": ("https://pythonhosted.org/blinker/", None),30 }31+issues_github_path = "pallets/flask"32 33 # HTML -----------------------------------------------------------------34 35 html_theme = "flask"12 unmodified lines48 "**": ["localtoc.html", "relations.html", "searchbox.html"],49 }50 singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}51 html_static_path = ["_static"]52-html_favicon = "_static/flask-favicon.ico"53-html_logo = "_static/flask.png"52+html_favicon = "_static/flask-icon.png"53+html_logo = "_static/flask-icon.png"54 html_title = "Flask Documentation ({})".format(version)55 html_show_sourcelink = False56 57 # LaTeX ----------------------------------------------------------------58 59 latex_documents = [60- (master_doc, "Flask.tex", "Flask Documentation", "Pallets Team", "manual")60+ (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")61 ]62-latex_use_modindex = False63-latex_elements = {64- "papersize": "a4paper",65- "pointsize": "12pt",66- "fontpkg": r"\usepackage{mathpazo}",67- "preamble": r"\usepackage{flaskstyle}",68-}69-latex_use_parts = True70-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/errorhandling.rst+2 added-2 removed
32 unmodified lines33 34 Sending error mails, even if just for critical ones, can become35 overwhelming if enough users are hitting the error and log files are36 typically never looked at. This is why we recommend using `Sentry37-<https://www.getsentry.com/>`_ for dealing with application errors. It's37+<https://sentry.io/welcome/>`_ for dealing with application errors. It's38 available as an Open Source project `on GitHub39 <https://github.com/getsentry/sentry>`__ and is also available as a `hosted version40-<https://getsentry.com/signup/>`_ which you can try for free. Sentry40+<https://sentry.io/signup/>`_ which you can try for free. Sentry41 aggregates duplicate errors, captures the full stack trace and local42 variables for debugging, and sends you mails based on new errors or43 frequency thresholds.44 171 unmodified linesmodified: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 not 13- % 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/189+.. _Dive Into HTML5: https://diveintohtml5.info/190 191 What should be used?192 --------------------193 14 unmodified linesmodified:docs/index.rst+67 added-3 removed
1 unmodified line2 3 Welcome to Flask4 ================5 6-.. image:: _static/logo-full.png6+.. image:: _static/flask-logo.png7 :alt: Flask: web development, one drop at a time8 :align: center9 :target: https://palletsprojects.com/p/flask/10 7 unmodified lines18 Flask depends on the `Jinja`_ template engine and the `Werkzeug`_ WSGI19 toolkit. The documentation for these libraries can be found at:20 21 - `Jinja documentation <http://jinja.pocoo.org/docs>`_22-- `Werkzeug documentation <http://werkzeug.pocoo.org/docs>`_22+- `Werkzeug documentation <https://werkzeug.palletsprojects.com/>`_23 24 .. _Jinja: https://www.palletsprojects.com/p/jinja/25 .. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/26 27-.. include:: contents.rst.inc27+28+User's Guide29+------------30+31+This part of the documentation, which is mostly prose, begins with some32+background information about Flask, then focuses on step-by-step33+instructions for web development with Flask.34+35+.. toctree::36+ :maxdepth: 237+38+ foreword39+ advanced_foreword40+ installation41+ quickstart42+ tutorial/index43+ templating44+ testing45+ errorhandling46+ logging47+ config48+ signals49+ views50+ appcontext51+ reqcontext52+ blueprints53+ extensions54+ cli55+ server56+ shell57+ patterns/index58+ deploying/index59+ becomingbig60+61+62+API Reference63+-------------64+65+If you are looking for information on a specific function, class or66+method, this part of the documentation is for you.67+68+.. toctree::69+ :maxdepth: 270+71+ api72+73+74+Additional Notes75+----------------76+77+Design notes, legal information and changelog are here for the interested.78+79+.. toctree::80+ :maxdepth: 281+82+ design83+ htmlfaq84+ security85+ unicode86+ extensiondev87+ styleguide88+ upgrading89+ changelog90+ license91+ 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.http://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 added-2 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".4 unmodified lines15 16 # Catch-all target: route all unknown targets to Sphinx using the new17 # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).18 %: Makefile20- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)19+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)modified: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 208 unmodified lines383 /hello.html384 385 For templates you can use the full power of Jinja2 templates. Head over386 to the official `Jinja2 Template Documentation387-<http://jinja.pocoo.org/docs/templates>`_ for more information.387+<http://jinja.pocoo.org/docs/templates/>`_ for more information.388 389 Here is an example template:390 391 .. sourcecode:: html+jinja426 unmodified lines818 app.logger.warning('A warning occurred (%d apples)', 42)819 app.logger.error('An error occurred')820 821 The attached :attr:`~flask.Flask.logger` is a standard logging822-:class:`~logging.Logger`, so head over to the official `logging823-documentation <https://docs.python.org/library/logging.html>`_ for more824-information.822+:class:`~logging.Logger`, so head over to the official :mod:`logging`823+docs for more information.824 825 Read more on :ref:`application-errors`.826 827 Hooking in WSGI Middlewares23 unmodified linesmodified:docs/requirements.txt+3 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 423 unmodified lines451 def test_hello_params():452 context = hello_command.make_context('hello', ['--name', 'flask'])453 assert context.params['name'] == 'FLASK'454 456-.. _click: http://click.pocoo.org/457-.. _utilities for testing: http://click.pocoo.org/testing455+.. _click: https://click.palletsprojects.com/456+.. _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-<http://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 linesmodified: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 uuid346 unmodified linesmodified: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 45 from base64 import b64decode, b64encode46 from datetime import datetime254 unmodified linesmodified:flask/__init__.py+2 added-2 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 13 __version__ = '1.0.3'14 35 unmodified linesmodified: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 main1 unmodified linemodified: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 14 import sys15 86 unmodified linesmodified:flask/app.py+2 added-2 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 12 import os13 import sys2327 unmodified linesmodified:flask/blueprints.py+2 added-2 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 _PackageBoundObject, _endpoint_from_view_func471 unmodified linesmodified: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 12 from __future__ import print_function13 897 unmodified linesmodified: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 12 import os13 import types256 unmodified linesmodified: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 12 import sys13 from functools import update_wrapper444 unmodified linesmodified: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 12 import os13 from warnings import warn155 unmodified linesmodified: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 13 from functools import partial14 from werkzeug.local import LocalStack, LocalProxy47 unmodified linesmodified: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 12 import os13 import socket1038 unmodified linesmodified: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 10 from __future__ import absolute_import11 67 unmodified linesmodified: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 12 import hashlib13 import warnings372 unmodified linesmodified: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 13 signals_available = False14 try:43 unmodified linesmodified: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 12 from jinja2 import BaseLoader, Environment as BaseEnvironment, \13 TemplateNotFound137 unmodified linesmodified: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 13 import werkzeug14 from contextlib import contextmanager232 unmodified linesmodified: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 12 from .globals import request13 from ._compat import with_metaclass145 unmodified linesmodified: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 12 from werkzeug.exceptions import BadRequest13 from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase203 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 date, datetime8-from subprocess import PIPE, Popen9-10-_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')11-12-13-def parse_changelog():14- with open('CHANGES.rst') as f:15- lineiter = iter(f)16- for line in lineiter:17- match = re.search('^Version\s+(.*)', line.strip())18-19- if match is None:20- continue21-22- version = match.group(1).strip()23-24- if next(lineiter).count('-') != len(match.group(0)):25- continue26-27- while 1:28- change_info = next(lineiter).strip()29-30- if change_info:31- break32-33- match = re.search(34- r'released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?',35- change_info,36- flags=re.IGNORECASE37- )38-39- if match is None:40- continue41-42- datestr, codename = match.groups()43- return version, parse_date(datestr), codename44-45-46-def bump_version(version):47- try:48- parts = [int(i) for i in version.split('.')]49- except ValueError:50- fail('Current version is not numeric')51-52- parts[-1] += 153- return '.'.join(map(str, parts))54-55-56-def parse_date(string):57- string = _date_strip_re.sub('', string)58- return datetime.strptime(string, '%B %d %Y')59-60-61-def set_filename_version(filename, version_number, pattern):62- changed = []63-64- def inject_version(match):65- before, old, after = match.groups()66- changed.append(True)67- return before + version_number + after68-69- with open(filename) as f:70- contents = re.sub(71- r"^(\s*%s\s*=\s*')(.+?)(')" % pattern,72- inject_version, f.read(),73- flags=re.DOTALL | re.MULTILINE74- )75-76- if not changed:77- fail('Could not find %s in %s', pattern, filename)78-79- with open(filename, 'w') as f:80- f.write(contents)81-82-83-def set_init_version(version):84- info('Setting __init__.py version to %s', version)85- set_filename_version('flask/__init__.py', version, '__version__')86-87-88-def build():89- cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel']90- Popen(cmd).wait()91-92-93-def fail(message, *args):94- print('Error:', message % args, file=sys.stderr)95- sys.exit(1)96-97-98-def info(message, *args):99- print(message % args, file=sys.stderr)100-101-102-def get_git_tags():103- return set(104- Popen(['git', 'tag'], stdout=PIPE).communicate()[0].splitlines()105- )106-107-108-def git_is_clean():109- return Popen(['git', 'diff', '--quiet']).wait() == 0110-111-112-def make_git_commit(message, *args):113- message = message % args114- Popen(['git', 'commit', '-am', message]).wait()115-116-117-def make_git_tag(tag):118- info('Tagging "%s"', tag)119- Popen(['git', 'tag', tag]).wait()120-121-122-def main():123- os.chdir(os.path.join(os.path.dirname(__file__), '..'))124-125- rv = parse_changelog()126-127- if rv is None:128- fail('Could not parse changelog')129-130- version, release_date, codename = rv131- dev_version = bump_version(version) + '.dev'132-133- info(134- 'Releasing %s (codename %s, release date %s)',135- version, codename, release_date.strftime('%d/%m/%Y')136- )137- tags = get_git_tags()138-139- if version in tags:140- fail('Version "%s" is already tagged', version)141-142- if release_date.date() != date.today():143- fail(144- 'Release date is not today (%s != %s)',145- release_date.date(), date.today()146- )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: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 10 import gc11 import os187 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 12 import pytest13 206 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 12 import re13 import time1935 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 12 import functools13 import pytest843 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 10 # This file was part of Flask-CLI and was modified under the terms of11 # its Revised BSD License. Copyright © 2015 CERN.566 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 10 from datetime import timedelta11 import os196 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 12 import datetime13 import os943 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 10 import os11 import sys124 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 10 from datetime import datetime11 from uuid import uuid479 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 10 import logging11 import sys96 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 12 import gc13 import sys86 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 12 import pytest13 209 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 12 import pytest13 190 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 13 import flask14 19 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 12 import pytest13 430 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 400 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 10 from werkzeug.exceptions import (11 Forbidden,188 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 12 import pytest13 226 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+601 added-650 removed
1 .. currentmodule:: flask2 3-Flask Changelog4-===============5-6-3 Version 1.0.34 -------------5 6 Released 2019-05-177 8 - :func:`send_file` encodes filenames as ASCII instead of Latin-19 (ISO-8859-1). This fixes compatibility with Gunicorn, which is14- stricter about header encodings than PEP 3333. (`#2766`_)10+ stricter about header encodings than PEP 3333. :issue:`2766`11 - Allow custom CLIs using ``FlaskGroup`` to set the debug flag without12 it always being overwritten based on environment variables.17- (`#2765`_)13+ :pr:`2765`14 - ``flask --version`` outputs Werkzeug's version and simplifies the19- Python version. (`#2825`_)15+ Python version. :pr:`2825`16 - :func:`send_file` handles an ``attachment_filename`` that is a21- native Python 2 string (bytes) with UTF-8 coded bytes. (`#2933`_)17+ native Python 2 string (bytes) with UTF-8 coded bytes. :issue:`2933`18 - A catch-all error handler registered for ``HTTPException`` will not19 handle ``RoutingExcpetion``, which is used internally during20 routing. This fixes the unexpected behavior that had been introduced25- in 1.0. (`#2986`_)21+ in 1.0. :pr:`2986`22 - Passing the ``json`` argument to ``app.test_client`` does not27- push/pop an extra app context. (`#2900`_)23+ push/pop an extra app context. :issue:`2900`24 29-.. _#2766: https://github.com/pallets/flask/issues/276630-.. _#2765: https://github.com/pallets/flask/pull/276531-.. _#2825: https://github.com/pallets/flask/pull/282532-.. _#2900: https://github.com/pallets/flask/issues/290033-.. _#2933: https://github.com/pallets/flask/issues/293334-.. _#2986: https://github.com/pallets/flask/pull/298625 36-26 Version 1.0.227 -------------28 29 Released 2018-05-0230 31 - Fix more backwards compatibility issues with merging slashes between43- a blueprint prefix and route. (`#2748`_)32+ a blueprint prefix and route. :pr:`2748`33 - Fix error with ``flask routes`` command when there are no routes.45- (`#2751`_)34+ :issue:`2751`35 47-.. _#2748: https://github.com/pallets/flask/pull/274848-.. _#2751: https://github.com/pallets/flask/issues/275136 50-37 Version 1.0.138 -------------39 40 Released 2018-04-2941 42 - Fix registering partials (with no ``__name__``) as view functions.57- (`#2730`_)43+ :pr:`2730`44 - Don't treat lists returned from view functions the same as tuples.59- Only tuples are interpreted as response data. (`#2736`_)45+ Only tuples are interpreted as response data. :issue:`2736`46 - Extra slashes between a blueprint's ``url_prefix`` and a route URL47 are merged. This fixes some backwards compatibility issues with the62- change in 1.0. (`#2731`_, `#2742`_)48+ change in 1.0. :issue:`2731`, :issue:`2742`49 - Only trap ``BadRequestKeyError`` errors in debug mode, not all50 ``BadRequest`` errors. This allows ``abort(400)`` to continue65- working as expected. (`#2735`_)51+ working as expected. :issue:`2735`52 - The ``FLASK_SKIP_DOTENV`` environment variable can be set to ``1``67- to skip automatically loading dotenv files. (`#2722`_)53+ to skip automatically loading dotenv files. :issue:`2722`54 69-.. _#2722: https://github.com/pallets/flask/issues/272270-.. _#2730: https://github.com/pallets/flask/pull/273071-.. _#2731: https://github.com/pallets/flask/issues/273172-.. _#2735: https://github.com/pallets/flask/issues/273573-.. _#2736: https://github.com/pallets/flask/issues/273674-.. _#2742: https://github.com/pallets/flask/issues/274255 76-56 Version 1.057 -----------58 59 Released 2018-04-2660 82-- **Python 2.6 and 3.3 are no longer supported.** (`pallets/meta#24`_)61+- Python 2.6 and 3.3 are no longer supported.62 - Bump minimum dependency versions to the latest stable versions:63 Werkzeug >= 0.14, Jinja >= 2.10, itsdangerous >= 0.24, Click >= 5.1.85- (`#2586`_)64+ :issue:`2586`65 - Skip :meth:`app.run <Flask.run>` when a Flask application is run66 from the command line. This avoids some behavior that was confusing67 to debug.68 - Change the default for :data:`JSONIFY_PRETTYPRINT_REGULAR` to69 ``False``. :func:`~json.jsonify` returns a compact format by91- default, and an indented format in debug mode. (`#2193`_)70+ default, and an indented format in debug mode. :pr:`2193`71 - :meth:`Flask.__init__ <Flask>` accepts the ``host_matching``93- argument and sets it on :attr:`~Flask.url_map`. (`#1559`_)72+ argument and sets it on :attr:`~Flask.url_map`. :issue:`1559`73 - :meth:`Flask.__init__ <Flask>` accepts the ``static_host`` argument74 and passes it as the ``host`` argument when defining the static96- route. (`#1559`_)75+ route. :issue:`1559`76 - :func:`send_file` supports Unicode in ``attachment_filename``.98- (`#2223`_)77+ :pr:`2223`78 - Pass ``_scheme`` argument from :func:`url_for` to100- :meth:`~Flask.handle_url_build_error`. (`#2017`_)79+ :meth:`~Flask.handle_url_build_error`. :pr:`2017`80 - :meth:`~Flask.add_url_rule` accepts the81 ``provide_automatic_options`` argument to disable adding the103- ``OPTIONS`` method. (`#1489`_)82+ ``OPTIONS`` method. :pr:`1489`83 - :class:`~views.MethodView` subclasses inherit method handlers from105- base classes. (`#1936`_)84+ base classes. :pr:`1936`85 - Errors caused while opening the session at the beginning of the107- request are handled by the app's error handlers. (`#2254`_)86+ request are handled by the app's error handlers. :pr:`2254`87 - Blueprints gained :attr:`~Blueprint.json_encoder` and88 :attr:`~Blueprint.json_decoder` attributes to override the app's110- encoder and decoder. (`#1898`_)89+ encoder and decoder. :pr:`1898`90 - :meth:`Flask.make_response` raises ``TypeError`` instead of91 ``ValueError`` for bad response types. The error messages have been113- improved to describe why the type is invalid. (`#2256`_)92+ improved to describe why the type is invalid. :pr:`2256`93 - Add ``routes`` CLI command to output routes registered on the115- application. (`#2259`_)94+ application. :pr:`2259`95 - Show warning when session cookie domain is a bare hostname or an IP96 address, as these may not behave properly in some browsers, such as118- Chrome. (`#2282`_)119-- Allow IP address as exact session cookie domain. (`#2282`_)97+ Chrome. :pr:`2282`98+- Allow IP address as exact session cookie domain. :pr:`2282`99 - ``SESSION_COOKIE_DOMAIN`` is set if it is detected through121- ``SERVER_NAME``. (`#2282`_)100+ ``SERVER_NAME``. :pr:`2282`101 - Auto-detect zero-argument app factory called ``create_app`` or123- ``make_app`` from ``FLASK_APP``. (`#2297`_)102+ ``make_app`` from ``FLASK_APP``. :pr:`2297`103 - Factory functions are not required to take a ``script_info``104 parameter to work with the ``flask`` command. If they take a single105 parameter or a parameter named ``script_info``, the127- :class:`~cli.ScriptInfo` object will be passed. (`#2319`_)106+ :class:`~cli.ScriptInfo` object will be passed. :pr:`2319`107 - ``FLASK_APP`` can be set to an app factory, with arguments if108 needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.130- (`#2326`_)109+ :pr:`2326`110 - ``FLASK_APP`` can point to local packages that are not installed in111 editable mode, although ``pip install -e`` is still preferred.133- (`#2414`_)112+ :pr:`2414`113 - The :class:`~views.View` class attribute114 :attr:`~views.View.provide_automatic_options` is set in115 :meth:`~views.View.as_view`, to be detected by137- :meth:`~Flask.add_url_rule`. (`#2316`_)116+ :meth:`~Flask.add_url_rule`. :pr:`2316`117 - Error handling will try handlers registered for ``blueprint, code``,118 ``app, code``, ``blueprint, exception``, ``app, exception``.140- (`#2314`_)119+ :pr:`2314`120 - ``Cookie`` is added to the response's ``Vary`` header if the session142- is accessed at all during the request (and not deleted). (`#2288`_)121+ is accessed at all during the request (and not deleted). :pr:`2288`122 - :meth:`~Flask.test_request_context` accepts ``subdomain`` and123 ``url_scheme`` arguments for use when building the base URL.145- (`#1621`_)124+ :pr:`1621`125 - Set :data:`APPLICATION_ROOT` to ``'/'`` by default. This was already126 the implicit default when it was set to ``None``.127 - :data:`TRAP_BAD_REQUEST_ERRORS` is enabled by default in debug mode.128 ``BadRequestKeyError`` has a message with the bad key in debug mode150- instead of the generic bad request message. (`#2348`_)129+ instead of the generic bad request message. :pr:`2348`130 - Allow registering new tags with131 :class:`~json.tag.TaggedJSONSerializer` to support storing other153- types in the session cookie. (`#2352`_)132+ types in the session cookie. :pr:`2352`133 - Only open the session if the request has not been pushed onto the134 context stack yet. This allows :func:`~stream_with_context`135 generators to access the same session that the containing view uses.157- (`#2354`_)136+ :pr:`2354`137 - Add ``json`` keyword argument for the test client request methods.138 This will dump the given object as JSON and set the appropriate160- content type. (`#2358`_)139+ content type. :pr:`2358`140 - Extract JSON handling to a mixin applied to both the141 :class:`Request` and :class:`Response` classes. This adds the142 :meth:`~Response.is_json` and :meth:`~Response.get_json` methods to164- the response to make testing JSON response much easier. (`#2358`_)143+ the response to make testing JSON response much easier. :pr:`2358`144 - Removed error handler caching because it caused unexpected results145 for some exception inheritance hierarchies. Register handlers146 explicitly for each exception if you want to avoid traversing the168- MRO. (`#2362`_)169-- Fix incorrect JSON encoding of aware, non-UTC datetimes. (`#2374`_)147+ MRO. :pr:`2362`148+- Fix incorrect JSON encoding of aware, non-UTC datetimes. :pr:`2374`149 - Template auto reloading will honor debug mode even even if171- :attr:`~Flask.jinja_env` was already accessed. (`#2373`_)172-- The following old deprecated code was removed. (`#2385`_)150+ :attr:`~Flask.jinja_env` was already accessed. :pr:`2373`151+- The following old deprecated code was removed. :issue:`2385`152 153 - ``flask.ext`` - import extensions directly by their name instead154 of through the ``flask.ext`` namespace. For example,155 ``import flask.ext.sqlalchemy`` becomes9 unmodified lines165 instead.166 - ``Request.module`` - use :attr:`Request.blueprint` instead.167 168 - The :attr:`Request.json` property is no longer deprecated.190- (`#1421`_)191-- Support passing a :class:`~werkzeug.test.EnvironBuilder` or192- ``dict`` to :meth:`test_client.open <werkzeug.test.Client.open>`.193- (`#2412`_)169+ :issue:`1421`170+- Support passing a :class:`~werkzeug.test.EnvironBuilder` or ``dict``171+ to :meth:`test_client.open <werkzeug.test.Client.open>`. :pr:`2412`172 - The ``flask`` command and :meth:`Flask.run` will load environment173 variables from ``.env`` and ``.flaskenv`` files if python-dotenv is196- installed. (`#2416`_)174+ installed. :pr:`2416`175 - When passing a full URL to the test client, the scheme in the URL is198- used instead of :data:`PREFERRED_URL_SCHEME`. (`#2430`_)176+ used instead of :data:`PREFERRED_URL_SCHEME`. :pr:`2430`177 - :attr:`Flask.logger` has been simplified. ``LOGGER_NAME`` and178 ``LOGGER_HANDLER_POLICY`` config was removed. The logger is always179 named ``flask.app``. The level is only set on first access, it180 doesn't check :attr:`Flask.debug` each time. Only one format is181 used, not different ones depending on :attr:`Flask.debug`. No182 handlers are removed, and a handler is only added if no handlers are205- already configured. (`#2436`_)206-- Blueprint view function names may not contain dots. (`#2450`_)183+ already configured. :pr:`2436`184+- Blueprint view function names may not contain dots. :pr:`2450`185 - Fix a ``ValueError`` caused by invalid ``Range`` requests in some208- cases. (`#2526`_)209-- The development server uses threads by default. (`#2529`_)186+ cases. :issue:`2526`187+- The development server uses threads by default. :pr:`2529`188 - Loading config files with ``silent=True`` will ignore211- :data:`~errno.ENOTDIR` errors. (`#2581`_)189+ :data:`~errno.ENOTDIR` errors. :pr:`2581`190 - Pass ``--cert`` and ``--key`` options to ``flask run`` to run the213- development server over HTTPS. (`#2606`_)191+ development server over HTTPS. :pr:`2606`192 - Added :data:`SESSION_COOKIE_SAMESITE` to control the ``SameSite``215- attribute on the session cookie. (`#2607`_)193+ attribute on the session cookie. :pr:`2607`194 - Added :meth:`~flask.Flask.test_cli_runner` to create a Click runner217- that can invoke Flask CLI commands for testing. (`#2636`_)195+ that can invoke Flask CLI commands for testing. :pr:`2636`196 - Subdomain matching is disabled by default and setting197 :data:`SERVER_NAME` does not implicily enable it. It can be enabled198 by passing ``subdomain_matching=True`` to the ``Flask`` constructor.221- (`#2635`_)199+ :pr:`2635`200 - A single trailing slash is stripped from the blueprint223- ``url_prefix`` when it is registered with the app. (`#2629`_)224-- :meth:`Request.get_json` doesn't cache the225- result if parsing fails when ``silent`` is true. (`#2651`_)201+ ``url_prefix`` when it is registered with the app. :pr:`2629`202+- :meth:`Request.get_json` doesn't cache the result if parsing fails203+ when ``silent`` is true. :issue:`2651`204 - :func:`Request.get_json` no longer accepts arbitrary encodings.205 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but228- Flask will autodetect UTF-8, -16, or -32. (`#2691`_)206+ Flask will autodetect UTF-8, -16, or -32. :pr:`2691`207 - Added :data:`MAX_COOKIE_SIZE` and :attr:`Response.max_cookie_size`208 to control when Werkzeug warns about large cookies that browsers may231- ignore. (`#2693`_)209+ ignore. :pr:`2693`210 - Updated documentation theme to make docs look better in small233- windows. (`#2709`_)211+ windows. :pr:`2709`212 - Rewrote the tutorial docs and example project to take a more213 structured approach to help new users avoid common pitfalls.236- (`#2676`_)214+ :pr:`2676`215 238-.. _pallets/meta#24: https://github.com/pallets/meta/issues/24239-.. _#1421: https://github.com/pallets/flask/issues/1421240-.. _#1489: https://github.com/pallets/flask/pull/1489241-.. _#1559: https://github.com/pallets/flask/issues/1559242-.. _#1621: https://github.com/pallets/flask/pull/1621243-.. _#1898: https://github.com/pallets/flask/pull/1898244-.. _#1936: https://github.com/pallets/flask/pull/1936245-.. _#2017: https://github.com/pallets/flask/pull/2017246-.. _#2193: https://github.com/pallets/flask/pull/2193247-.. _#2223: https://github.com/pallets/flask/pull/2223248-.. _#2254: https://github.com/pallets/flask/pull/2254249-.. _#2256: https://github.com/pallets/flask/pull/2256250-.. _#2259: https://github.com/pallets/flask/pull/2259251-.. _#2282: https://github.com/pallets/flask/pull/2282252-.. _#2288: https://github.com/pallets/flask/pull/2288253-.. _#2297: https://github.com/pallets/flask/pull/2297254-.. _#2314: https://github.com/pallets/flask/pull/2314255-.. _#2316: https://github.com/pallets/flask/pull/2316256-.. _#2319: https://github.com/pallets/flask/pull/2319257-.. _#2326: https://github.com/pallets/flask/pull/2326258-.. _#2348: https://github.com/pallets/flask/pull/2348259-.. _#2352: https://github.com/pallets/flask/pull/2352260-.. _#2354: https://github.com/pallets/flask/pull/2354261-.. _#2358: https://github.com/pallets/flask/pull/2358262-.. _#2362: https://github.com/pallets/flask/pull/2362263-.. _#2374: https://github.com/pallets/flask/pull/2374264-.. _#2373: https://github.com/pallets/flask/pull/2373265-.. _#2385: https://github.com/pallets/flask/issues/2385266-.. _#2412: https://github.com/pallets/flask/pull/2412267-.. _#2414: https://github.com/pallets/flask/pull/2414268-.. _#2416: https://github.com/pallets/flask/pull/2416269-.. _#2430: https://github.com/pallets/flask/pull/2430270-.. _#2436: https://github.com/pallets/flask/pull/2436271-.. _#2450: https://github.com/pallets/flask/pull/2450272-.. _#2526: https://github.com/pallets/flask/issues/2526273-.. _#2529: https://github.com/pallets/flask/pull/2529274-.. _#2586: https://github.com/pallets/flask/issues/2586275-.. _#2581: https://github.com/pallets/flask/pull/2581276-.. _#2606: https://github.com/pallets/flask/pull/2606277-.. _#2607: https://github.com/pallets/flask/pull/2607278-.. _#2636: https://github.com/pallets/flask/pull/2636279-.. _#2635: https://github.com/pallets/flask/pull/2635280-.. _#2629: https://github.com/pallets/flask/pull/2629281-.. _#2651: https://github.com/pallets/flask/issues/2651282-.. _#2676: https://github.com/pallets/flask/pull/2676283-.. _#2691: https://github.com/pallets/flask/pull/2691284-.. _#2693: https://github.com/pallets/flask/pull/2693285-.. _#2709: https://github.com/pallets/flask/pull/2709216 287-217 Version 0.12.4218 --------------219 291-Released on April 29 2018220+Released 2018-04-29221 293-- Repackage 0.12.3 to fix package layout issue. (`#2728`_)222+- Repackage 0.12.3 to fix package layout issue. :issue:`2728`223 295-.. _#2728: https://github.com/pallets/flask/issues/2728224 297-225 Version 0.12.3226 --------------227 301-Released on April 26th 2018228+Released 2018-04-26229 230 - :func:`Request.get_json` no longer accepts arbitrary encodings.231 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but305- Flask will autodetect UTF-8, -16, or -32. (`#2692`_)232+ Flask will autodetect UTF-8, -16, or -32. :issue:`2692`233 - Fix a Python warning about imports when using ``python -m flask``.307- (`#2666`_)234+ :issue:`2666`235 - Fix a ``ValueError`` caused by invalid ``Range`` requests in some236 cases.237 311-.. _#2666: https://github.com/pallets/flask/issues/2666312-.. _#2692: https://github.com/pallets/flask/issues/2692238 314-239 Version 0.12.2240 --------------241 318-Released on May 16 2017242+Released 2017-05-16243 320-- Fix a bug in `safe_join` on Windows.244+- Fix a bug in ``safe_join`` on Windows.245 246+247 Version 0.12.1248 --------------249 325-Bugfix release, released on March 31st 2017250+Released 2017-03-31251 327-- Prevent `flask run` from showing a NoAppException when an ImportError occurs328- within the imported application module.329-- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix330- ``#2118``.331-- Use the ``SERVER_NAME`` config if it is present as default values for332- ``app.run``. ``#2109``, ``#2152``333-- Call `ctx.auto_pop` with the exception object instead of `None`, in the334- event that a `BaseException` such as `KeyboardInterrupt` is raised in a335- request handler.252+- Prevent ``flask run`` from showing a ``NoAppException`` when an253+ ``ImportError`` occurs within the imported application module.254+- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3.255+ :issue:`2118`256+- Use the ``SERVER_NAME`` config if it is present as default values257+ for ``app.run``. :issue:`2109`, :pr:`2152`258+- Call ``ctx.auto_pop`` with the exception object instead of ``None``,259+ in the event that a ``BaseException`` such as ``KeyboardInterrupt``260+ is raised in a request handler.261 262+263 Version 0.12264 ------------265 340-Released on December 21st 2016, codename Punsch.266+Released 2016-12-21, codename Punsch267 342-- the cli command now responds to `--version`.343-- Mimetype guessing and ETag generation for file-like objects in ``send_file``344- has been removed, as per issue ``#104``. See pull request ``#1849``.345-- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to346- ``application/octet-stream``. See pull request ``#1988``.347-- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``348- (pull request ``#1730``).349-- Revert a behavior change that made the dev server crash instead of returning350- a Internal Server Error (pull request ``#2006``).351-- Correctly invoke response handlers for both regular request dispatching as352- well as error handlers.353-- Disable logger propagation by default for the app logger.354-- Add support for range requests in ``send_file``.355-- ``app.test_client`` includes preset default environment, which can now be356- directly set, instead of per ``client.get``.268+- The cli command now responds to ``--version``.269+- Mimetype guessing and ETag generation for file-like objects in270+ ``send_file`` has been removed. :issue:`104`, :pr`1849`271+- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall272+ back to ``application/octet-stream``. :pr:`1988`273+- Make ``flask.safe_join`` able to join multiple paths like274+ ``os.path.join`` :pr:`1730`275+- Revert a behavior change that made the dev server crash instead of276+ returning an Internal Server Error. :pr:`2006`277+- Correctly invoke response handlers for both regular request278+ dispatching as well as error handlers.279+- Disable logger propagation by default for the app logger.280+- Add support for range requests in ``send_file``.281+- ``app.test_client`` includes preset default environment, which can282+ now be directly set, instead of per ``client.get``.283+- Fix crash when running under PyPy3. :pr:`1814`284 358-Version 0.11.2359---------------285 361-Bugfix release, unreleased362-363-- Fix crash when running under PyPy3, see pull request ``#1814``.364-286 Version 0.11.1287 --------------288 368-Bugfix release, released on June 7th 2016.289+Released 2016-06-07290 370-- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from working. See371- pull request ``#1872``.291+- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from292+ working. :pr:`1872`293 294+295 Version 0.11296 ------------297 376-Released on May 29th 2016, codename Absinthe.298+Released 2016-05-29, codename Absinthe299 378-- Added support to serializing top-level arrays to :func:`flask.jsonify`. This379- introduces a security risk in ancient browsers. See380- :ref:`json-security` for details.381-- Added before_render_template signal.382-- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing383- additional keyword arguments to the constructor of384- :attr:`flask.Flask.test_client_class`.385-- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the386- set-cookie behavior. If set to ``True`` a permanent session will be387- refreshed each request and get their lifetime extended, if set to388- ``False`` it will only be modified if the session actually modifies.389- Non permanent sessions are not affected by this and will always390- expire if the browser window closes.391-- Made Flask support custom JSON mimetypes for incoming data.392-- Added support for returning tuples in the form ``(response, headers)``393- from a view function.394-- Added :meth:`flask.Config.from_json`.395-- Added :attr:`flask.Flask.config_class`.396-- Added :meth:`flask.Config.get_namespace`.397-- Templates are no longer automatically reloaded outside of debug mode. This398- can be configured with the new ``TEMPLATES_AUTO_RELOAD`` config key.399-- Added a workaround for a limitation in Python 3.3's namespace loader.400-- Added support for explicit root paths when using Python 3.3's namespace401- packages.402-- Added :command:`flask` and the ``flask.cli`` module to start the local403- debug server through the click CLI system. This is recommended over the old404- ``flask.run()`` method as it works faster and more reliable due to a405- different design and also replaces ``Flask-Script``.406-- Error handlers that match specific classes are now checked first,407- thereby allowing catching exceptions that are subclasses of HTTP408- exceptions (in ``werkzeug.exceptions``). This makes it possible409- for an extension author to create exceptions that will by default410- result in the HTTP error of their choosing, but may be caught with411- a custom error handler if desired.412-- Added :meth:`flask.Config.from_mapping`.413-- Flask will now log by default even if debug is disabled. The log format is414- now hardcoded but the default log handling can be disabled through the415- ``LOGGER_HANDLER_POLICY`` configuration key.416-- Removed deprecated module functionality.417-- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when enabled will418- instruct Flask to explain how it locates templates. This should help419- users debug when the wrong templates are loaded.420-- Enforce blueprint handling in the order they were registered for template421- loading.422-- Ported test suite to py.test.423-- Deprecated ``request.json`` in favour of ``request.get_json()``.424-- Add "pretty" and "compressed" separators definitions in jsonify() method.425- Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing426- unnecessary white space included by default after separators.427-- JSON responses are now terminated with a newline character, because it is a428- convention that UNIX text files end with a newline and some clients don't429- deal well when this newline is missing. See430- https://github.com/pallets/flask/pull/1262 -- this came up originally as a431- part of https://github.com/kennethreitz/httpbin/issues/168432-- The automatically provided ``OPTIONS`` method is now correctly disabled if433- the user registered an overriding rule with the lowercase-version434- ``options`` (issue ``#1288``).435-- ``flask.json.jsonify`` now supports the ``datetime.date`` type (pull request436- ``#1326``).437-- Don't leak exception info of already catched exceptions to context teardown438- handlers (pull request ``#1393``).439-- Allow custom Jinja environment subclasses (pull request ``#1422``).440-- Updated extension dev guidelines.300+- Added support to serializing top-level arrays to301+ :func:`flask.jsonify`. This introduces a security risk in ancient302+ browsers. See :ref:`json-security` for details.303+- Added before_render_template signal.304+- Added ``**kwargs`` to :meth:`flask.Test.test_client` to support305+ passing additional keyword arguments to the constructor of306+ :attr:`flask.Flask.test_client_class`.307+- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the308+ set-cookie behavior. If set to ``True`` a permanent session will be309+ refreshed each request and get their lifetime extended, if set to310+ ``False`` it will only be modified if the session actually modifies.311+ Non permanent sessions are not affected by this and will always312+ expire if the browser window closes.313+- Made Flask support custom JSON mimetypes for incoming data.314+- Added support for returning tuples in the form ``(response,315+ headers)`` from a view function.316+- Added :meth:`flask.Config.from_json`.317+- Added :attr:`flask.Flask.config_class`.318+- Added :meth:`flask.Config.get_namespace`.319+- Templates are no longer automatically reloaded outside of debug320+ mode. This can be configured with the new ``TEMPLATES_AUTO_RELOAD``321+ config key.322+- Added a workaround for a limitation in Python 3.3's namespace323+ loader.324+- Added support for explicit root paths when using Python 3.3's325+ namespace packages.326+- Added :command:`flask` and the ``flask.cli`` module to start the327+ local debug server through the click CLI system. This is recommended328+ over the old ``flask.run()`` method as it works faster and more329+ reliable due to a different design and also replaces330+ ``Flask-Script``.331+- Error handlers that match specific classes are now checked first,332+ thereby allowing catching exceptions that are subclasses of HTTP333+ exceptions (in ``werkzeug.exceptions``). This makes it possible for334+ an extension author to create exceptions that will by default result335+ in the HTTP error of their choosing, but may be caught with a custom336+ error handler if desired.337+- Added :meth:`flask.Config.from_mapping`.338+- Flask will now log by default even if debug is disabled. The log339+ format is now hardcoded but the default log handling can be disabled340+ through the ``LOGGER_HANDLER_POLICY`` configuration key.341+- Removed deprecated module functionality.342+- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when343+ enabled will instruct Flask to explain how it locates templates.344+ This should help users debug when the wrong templates are loaded.345+- Enforce blueprint handling in the order they were registered for346+ template loading.347+- Ported test suite to py.test.348+- Deprecated ``request.json`` in favour of ``request.get_json()``.349+- Add "pretty" and "compressed" separators definitions in jsonify()350+ method. Reduces JSON response size when351+ ``JSONIFY_PRETTYPRINT_REGULAR=False`` by removing unnecessary white352+ space included by default after separators.353+- JSON responses are now terminated with a newline character, because354+ it is a convention that UNIX text files end with a newline and some355+ clients don't deal well when this newline is missing. This came up356+ originally as a part of357+ https://github.com/postmanlabs/httpbin/issues/168. :pr:`1262`358+- The automatically provided ``OPTIONS`` method is now correctly359+ disabled if the user registered an overriding rule with the360+ lowercase-version ``options``. :issue:`1288`361+- ``flask.json.jsonify`` now supports the ``datetime.date`` type.362+ :pr:`1326`363+- Don't leak exception info of already caught exceptions to context364+ teardown handlers. :pr:`1393`365+- Allow custom Jinja environment subclasses. :pr:`1422`366+- Updated extension dev guidelines.367+- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.368+- Turn on autoescape for ``flask.templating.render_template_string``369+ by default. :pr:`1515`370+- ``flask.ext`` is now deprecated. :pr:`1484`371+- ``send_from_directory`` now raises BadRequest if the filename is372+ invalid on the server OS. :pr:`1763`373+- Added the ``JSONIFY_MIMETYPE`` configuration variable. :pr:`1728`374+- Exceptions during teardown handling will no longer leave bad375+ application contexts lingering around.376+- Fixed broken ``test_appcontext_signals()`` test case.377+- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package`378+ with a useful message explaining why it is raised when a PEP 302379+ import hook is used without an ``is_package()`` method.380+- Fixed an issue causing exceptions raised before entering a request381+ or app context to be passed to teardown handlers.382+- Fixed an issue with query parameters getting removed from requests383+ in the test client when absolute URLs were requested.384+- Made ``@before_first_request`` into a decorator as intended.385+- Fixed an etags bug when sending a file streams with a name.386+- Fixed ``send_from_directory`` not expanding to the application root387+ path correctly.388+- Changed logic of before first request handlers to flip the flag389+ after invoking. This will allow some uses that are potentially390+ dangerous but should probably be permitted.391+- Fixed Python 3 bug when a handler from392+ ``app.url_build_error_handlers`` reraises the ``BuildError``.393 442-- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.443-- Turn on autoescape for ``flask.templating.render_template_string`` by default444- (pull request ``#1515``).445-- ``flask.ext`` is now deprecated (pull request ``#1484``).446-- ``send_from_directory`` now raises BadRequest if the filename is invalid on447- the server OS (pull request ``#1763``).448-- Added the ``JSONIFY_MIMETYPE`` configuration variable (pull request ``#1728``).449-- Exceptions during teardown handling will no longer leave bad application450- contexts lingering around.394 452-Version 0.10.2453---------------454-455-(bugfix release, release date to be announced)456-457-- Fixed broken `test_appcontext_signals()` test case.458-- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a459- useful message explaining why it is raised when a PEP 302 import hook is used460- without an `is_package()` method.461-- Fixed an issue causing exceptions raised before entering a request or app462- context to be passed to teardown handlers.463-- Fixed an issue with query parameters getting removed from requests in464- the test client when absolute URLs were requested.465-- Made `@before_first_request` into a decorator as intended.466-- Fixed an etags bug when sending a file streams with a name.467-- Fixed `send_from_directory` not expanding to the application root path468- correctly.469-- Changed logic of before first request handlers to flip the flag after470- invoking. This will allow some uses that are potentially dangerous but471- should probably be permitted.472-- Fixed Python 3 bug when a handler from `app.url_build_error_handlers`473- reraises the `BuildError`.474-395 Version 0.10.1396 --------------397 478-(bugfix release, released on June 14th 2013)398+Released 2013-06-14399 480-- Fixed an issue where ``|tojson`` was not quoting single quotes which481- made the filter not work properly in HTML attributes. Now it's482- possible to use that filter in single quoted attributes. This should483- make using that filter with angular.js easier.484-- Added support for byte strings back to the session system. This broke485- compatibility with the common case of people putting binary data for486- token verification into the session.487-- Fixed an issue where registering the same method twice for the same endpoint488- would trigger an exception incorrectly.400+- Fixed an issue where ``|tojson`` was not quoting single quotes which401+ made the filter not work properly in HTML attributes. Now it's402+ possible to use that filter in single quoted attributes. This should403+ make using that filter with angular.js easier.404+- Added support for byte strings back to the session system. This405+ broke compatibility with the common case of people putting binary406+ data for token verification into the session.407+- Fixed an issue where registering the same method twice for the same408+ endpoint would trigger an exception incorrectly.409 410+411 Version 0.10412 ------------413 493-Released on June 13th 2013, codename Limoncello.414+Released 2013-06-13, codename Limoncello415 495-- Changed default cookie serialization format from pickle to JSON to496- limit the impact an attacker can do if the secret key leaks. See497- :ref:`upgrading-to-010` for more information.498-- Added ``template_test`` methods in addition to the already existing499- ``template_filter`` method family.500-- Added ``template_global`` methods in addition to the already existing501- ``template_filter`` method family.502-- Set the content-length header for x-sendfile.503-- ``tojson`` filter now does not escape script blocks in HTML5 parsers.504-- ``tojson`` used in templates is now safe by default due. This was505- allowed due to the different escaping behavior.506-- Flask will now raise an error if you attempt to register a new function507- on an already used endpoint.508-- Added wrapper module around simplejson and added default serialization509- of datetime objects. This allows much easier customization of how510- JSON is handled by Flask or any Flask extension.511-- Removed deprecated internal ``flask.session`` module alias. Use512- ``flask.sessions`` instead to get the session module. This is not to513- be confused with ``flask.session`` the session proxy.514-- Templates can now be rendered without request context. The behavior is515- slightly different as the ``request``, ``session`` and ``g`` objects516- will not be available and blueprint's context processors are not517- called.518-- The config object is now available to the template as a real global and519- not through a context processor which makes it available even in imported520- templates by default.521-- Added an option to generate non-ascii encoded JSON which should result522- in less bytes being transmitted over the network. It's disabled by523- default to not cause confusion with existing libraries that might expect524- ``flask.json.dumps`` to return bytestrings by default.525-- ``flask.g`` is now stored on the app context instead of the request526- context.527-- ``flask.g`` now gained a ``get()`` method for not erroring out on non528- existing items.529-- ``flask.g`` now can be used with the ``in`` operator to see what's defined530- and it now is iterable and will yield all attributes stored.531-- ``flask.Flask.request_globals_class`` got renamed to532- ``flask.Flask.app_ctx_globals_class`` which is a better name to what it533- does since 0.10.534-- `request`, `session` and `g` are now also added as proxies to the template535- context which makes them available in imported templates. One has to be536- very careful with those though because usage outside of macros might537- cause caching.538-- Flask will no longer invoke the wrong error handlers if a proxy539- exception is passed through.540-- Added a workaround for chrome's cookies in localhost not working541- as intended with domain names.542-- Changed logic for picking defaults for cookie values from sessions543- to work better with Google Chrome.544-- Added `message_flashed` signal that simplifies flashing testing.545-- Added support for copying of request contexts for better working with546- greenlets.547-- Removed custom JSON HTTP exception subclasses. If you were relying on them548- you can reintroduce them again yourself trivially. Using them however is549- strongly discouraged as the interface was flawed.550-- Python requirements changed: requiring Python 2.6 or 2.7 now to prepare551- for Python 3.3 port.552-- Changed how the teardown system is informed about exceptions. This is now553- more reliable in case something handles an exception halfway through554- the error handling process.555-- Request context preservation in debug mode now keeps the exception556- information around which means that teardown handlers are able to557- distinguish error from success cases.558-- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.559-- Flask now orders JSON keys by default to not trash HTTP caches due to560- different hash seeds between different workers.561-- Added `appcontext_pushed` and `appcontext_popped` signals.562-- The builtin run method now takes the ``SERVER_NAME`` into account when563- picking the default port to run on.564-- Added `flask.request.get_json()` as a replacement for the old565- `flask.request.json` property.416+- Changed default cookie serialization format from pickle to JSON to417+ limit the impact an attacker can do if the secret key leaks. See418+ :ref:`upgrading-to-010` for more information.419+- Added ``template_test`` methods in addition to the already existing420+ ``template_filter`` method family.421+- Added ``template_global`` methods in addition to the already422+ existing ``template_filter`` method family.423+- Set the content-length header for x-sendfile.424+- ``tojson`` filter now does not escape script blocks in HTML5425+ parsers.426+- ``tojson`` used in templates is now safe by default due. This was427+ allowed due to the different escaping behavior.428+- Flask will now raise an error if you attempt to register a new429+ function on an already used endpoint.430+- Added wrapper module around simplejson and added default431+ serialization of datetime objects. This allows much easier432+ customization of how JSON is handled by Flask or any Flask433+ extension.434+- Removed deprecated internal ``flask.session`` module alias. Use435+ ``flask.sessions`` instead to get the session module. This is not to436+ be confused with ``flask.session`` the session proxy.437+- Templates can now be rendered without request context. The behavior438+ is slightly different as the ``request``, ``session`` and ``g``439+ objects will not be available and blueprint's context processors are440+ not called.441+- The config object is now available to the template as a real global442+ and not through a context processor which makes it available even in443+ imported templates by default.444+- Added an option to generate non-ascii encoded JSON which should445+ result in less bytes being transmitted over the network. It's446+ disabled by default to not cause confusion with existing libraries447+ that might expect ``flask.json.dumps`` to return bytestrings by448+ default.449+- ``flask.g`` is now stored on the app context instead of the request450+ context.451+- ``flask.g`` now gained a ``get()`` method for not erroring out on452+ non existing items.453+- ``flask.g`` now can be used with the ``in`` operator to see what's454+ defined and it now is iterable and will yield all attributes stored.455+- ``flask.Flask.request_globals_class`` got renamed to456+ ``flask.Flask.app_ctx_globals_class`` which is a better name to what457+ it does since 0.10.458+- ``request``, ``session`` and ``g`` are now also added as proxies to459+ the template context which makes them available in imported460+ templates. One has to be very careful with those though because461+ usage outside of macros might cause caching.462+- Flask will no longer invoke the wrong error handlers if a proxy463+ exception is passed through.464+- Added a workaround for chrome's cookies in localhost not working as465+ intended with domain names.466+- Changed logic for picking defaults for cookie values from sessions467+ to work better with Google Chrome.468+- Added ``message_flashed`` signal that simplifies flashing testing.469+- Added support for copying of request contexts for better working470+ with greenlets.471+- Removed custom JSON HTTP exception subclasses. If you were relying472+ on them you can reintroduce them again yourself trivially. Using473+ them however is strongly discouraged as the interface was flawed.474+- Python requirements changed: requiring Python 2.6 or 2.7 now to475+ prepare for Python 3.3 port.476+- Changed how the teardown system is informed about exceptions. This477+ is now more reliable in case something handles an exception halfway478+ through the error handling process.479+- Request context preservation in debug mode now keeps the exception480+ information around which means that teardown handlers are able to481+ distinguish error from success cases.482+- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.483+- Flask now orders JSON keys by default to not trash HTTP caches due484+ to different hash seeds between different workers.485+- Added ``appcontext_pushed`` and ``appcontext_popped`` signals.486+- The builtin run method now takes the ``SERVER_NAME`` into account487+ when picking the default port to run on.488+- Added ``flask.request.get_json()`` as a replacement for the old489+ ``flask.request.json`` property.490 491+492 Version 0.9493 -----------494 570-Released on July 1st 2012, codename Campari.495+Released 2012-07-01, codename Campari496 572-- The :func:`flask.Request.on_json_loading_failed` now returns a JSON formatted573- response by default.574-- The :func:`flask.url_for` function now can generate anchors to the575- generated links.576-- The :func:`flask.url_for` function now can also explicitly generate577- URL rules specific to a given HTTP method.578-- Logger now only returns the debug log setting if it was not set579- explicitly.580-- Unregister a circular dependency between the WSGI environment and581- the request object when shutting down the request. This means that582- environ ``werkzeug.request`` will be ``None`` after the response was583- returned to the WSGI server but has the advantage that the garbage584- collector is not needed on CPython to tear down the request unless585- the user created circular dependencies themselves.586-- Session is now stored after callbacks so that if the session payload587- is stored in the session you can still modify it in an after588- request callback.589-- The :class:`flask.Flask` class will avoid importing the provided import name590- if it can (the required first parameter), to benefit tools which build Flask591- instances programmatically. The Flask class will fall back to using import592- on systems with custom module hooks, e.g. Google App Engine, or when the593- import name is inside a zip archive (usually a .egg) prior to Python 2.7.594-- Blueprints now have a decorator to add custom template filters application595- wide, :meth:`flask.Blueprint.app_template_filter`.596-- The Flask and Blueprint classes now have a non-decorator method for adding597- custom template filters application wide,598- :meth:`flask.Flask.add_template_filter` and599- :meth:`flask.Blueprint.add_app_template_filter`.600-- The :func:`flask.get_flashed_messages` function now allows rendering flashed601- message categories in separate blocks, through a ``category_filter``602- argument.603-- The :meth:`flask.Flask.run` method now accepts ``None`` for `host` and `port`604- arguments, using default values when ``None``. This allows for calling run605- using configuration values, e.g. ``app.run(app.config.get('MYHOST'),606- app.config.get('MYPORT'))``, with proper behavior whether or not a config607- file is provided.608-- The :meth:`flask.render_template` method now accepts a either an iterable of609- template names or a single template name. Previously, it only accepted a610- single template name. On an iterable, the first template found is rendered.611-- Added :meth:`flask.Flask.app_context` which works very similar to the612- request context but only provides access to the current application. This613- also adds support for URL generation without an active request context.614-- View functions can now return a tuple with the first instance being an615- instance of :class:`flask.Response`. This allows for returning616- ``jsonify(error="error msg"), 400`` from a view function.617-- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a618- :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to override619- behavior of serving static files from Flask when using620- :meth:`flask.Flask.send_static_file` (used for the default static file621- handler) and :func:`~flask.helpers.send_file`. This hook is provided a622- filename, which for example allows changing cache controls by file extension.623- The default max-age for `send_file` and static files can be configured624- through a new ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is625- used in the default `get_send_file_max_age` implementation.626-- Fixed an assumption in sessions implementation which could break message627- flashing on sessions implementations which use external storage.628-- Changed the behavior of tuple return values from functions. They are no629- longer arguments to the response object, they now have a defined meaning.630-- Added :attr:`flask.Flask.request_globals_class` to allow a specific class to631- be used on creation of the :data:`~flask.g` instance of each request.632-- Added `required_methods` attribute to view functions to force-add methods633- on registration.634-- Added :func:`flask.after_this_request`.635-- Added :func:`flask.stream_with_context` and the ability to push contexts636- multiple times without producing unexpected behavior.497+- The :func:`flask.Request.on_json_loading_failed` now returns a JSON498+ formatted response by default.499+- The :func:`flask.url_for` function now can generate anchors to the500+ generated links.501+- The :func:`flask.url_for` function now can also explicitly generate502+ URL rules specific to a given HTTP method.503+- Logger now only returns the debug log setting if it was not set504+ explicitly.505+- Unregister a circular dependency between the WSGI environment and506+ the request object when shutting down the request. This means that507+ environ ``werkzeug.request`` will be ``None`` after the response was508+ returned to the WSGI server but has the advantage that the garbage509+ collector is not needed on CPython to tear down the request unless510+ the user created circular dependencies themselves.511+- Session is now stored after callbacks so that if the session payload512+ is stored in the session you can still modify it in an after request513+ callback.514+- The :class:`flask.Flask` class will avoid importing the provided515+ import name if it can (the required first parameter), to benefit516+ tools which build Flask instances programmatically. The Flask class517+ will fall back to using import on systems with custom module hooks,518+ e.g. Google App Engine, or when the import name is inside a zip519+ archive (usually a .egg) prior to Python 2.7.520+- Blueprints now have a decorator to add custom template filters521+ application wide, :meth:`flask.Blueprint.app_template_filter`.522+- The Flask and Blueprint classes now have a non-decorator method for523+ adding custom template filters application wide,524+ :meth:`flask.Flask.add_template_filter` and525+ :meth:`flask.Blueprint.add_app_template_filter`.526+- The :func:`flask.get_flashed_messages` function now allows rendering527+ flashed message categories in separate blocks, through a528+ ``category_filter`` argument.529+- The :meth:`flask.Flask.run` method now accepts ``None`` for ``host``530+ and ``port`` arguments, using default values when ``None``. This531+ allows for calling run using configuration values, e.g.532+ ``app.run(app.config.get('MYHOST'), app.config.get('MYPORT'))``,533+ with proper behavior whether or not a config file is provided.534+- The :meth:`flask.render_template` method now accepts a either an535+ iterable of template names or a single template name. Previously, it536+ only accepted a single template name. On an iterable, the first537+ template found is rendered.538+- Added :meth:`flask.Flask.app_context` which works very similar to539+ the request context but only provides access to the current540+ application. This also adds support for URL generation without an541+ active request context.542+- View functions can now return a tuple with the first instance being543+ an instance of :class:`flask.Response`. This allows for returning544+ ``jsonify(error="error msg"), 400`` from a view function.545+- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a546+ :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to547+ override behavior of serving static files from Flask when using548+ :meth:`flask.Flask.send_static_file` (used for the default static549+ file handler) and :func:`~flask.helpers.send_file`. This hook is550+ provided a filename, which for example allows changing cache551+ controls by file extension. The default max-age for ``send_file``552+ and static files can be configured through a new553+ ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used554+ in the default ``get_send_file_max_age`` implementation.555+- Fixed an assumption in sessions implementation which could break556+ message flashing on sessions implementations which use external557+ storage.558+- Changed the behavior of tuple return values from functions. They are559+ no longer arguments to the response object, they now have a defined560+ meaning.561+- Added :attr:`flask.Flask.request_globals_class` to allow a specific562+ class to be used on creation of the :data:`~flask.g` instance of563+ each request.564+- Added ``required_methods`` attribute to view functions to force-add565+ methods on registration.566+- Added :func:`flask.after_this_request`.567+- Added :func:`flask.stream_with_context` and the ability to push568+ contexts multiple times without producing unexpected behavior.569 570+571 Version 0.8.1572 -------------573 641-Bugfix release, released on July 1st 2012574+Released 2012-07-01575 643-- Fixed an issue with the undocumented `flask.session` module to not644- work properly on Python 2.5. It should not be used but did cause645- some problems for package managers.576+- Fixed an issue with the undocumented ``flask.session`` module to not577+ work properly on Python 2.5. It should not be used but did cause578+ some problems for package managers.579 580+581 Version 0.8582 -----------583 650-Released on September 29th 2011, codename Rakija584+Released 2011-09-29, codename Rakija585 652-- Refactored session support into a session interface so that653- the implementation of the sessions can be changed without654- having to override the Flask class.655-- Empty session cookies are now deleted properly automatically.656-- View functions can now opt out of getting the automatic657- OPTIONS implementation.658-- HTTP exceptions and Bad Request errors can now be trapped so that they659- show up normally in the traceback.660-- Flask in debug mode is now detecting some common problems and tries to661- warn you about them.662-- Flask in debug mode will now complain with an assertion error if a view663- was attached after the first request was handled. This gives earlier664- feedback when users forget to import view code ahead of time.665-- Added the ability to register callbacks that are only triggered once at666- the beginning of the first request. (:meth:`Flask.before_first_request`)667-- Malformed JSON data will now trigger a bad request HTTP exception instead668- of a value error which usually would result in a 500 internal server669- error if not handled. This is a backwards incompatible change.670-- Applications now not only have a root path where the resources and modules671- are located but also an instance path which is the designated place to672- drop files that are modified at runtime (uploads etc.). Also this is673- conceptually only instance depending and outside version control so it's674- the perfect place to put configuration files etc. For more information675- see :ref:`instance-folders`.676-- Added the ``APPLICATION_ROOT`` configuration variable.677-- Implemented :meth:`~flask.testing.TestClient.session_transaction` to678- easily modify sessions from the test environment.679-- Refactored test client internally. The ``APPLICATION_ROOT`` configuration680- variable as well as ``SERVER_NAME`` are now properly used by the test client681- as defaults.682-- Added :attr:`flask.views.View.decorators` to support simpler decorating of683- pluggable (class-based) views.684-- Fixed an issue where the test client if used with the "with" statement did not685- trigger the execution of the teardown handlers.686-- Added finer control over the session cookie parameters.687-- HEAD requests to a method view now automatically dispatch to the `get`688- method if no handler was implemented.689-- Implemented the virtual :mod:`flask.ext` package to import extensions from.690-- The context preservation on exceptions is now an integral component of691- Flask itself and no longer of the test client. This cleaned up some692- internal logic and lowers the odds of runaway request contexts in unittests.586+- Refactored session support into a session interface so that the587+ implementation of the sessions can be changed without having to588+ override the Flask class.589+- Empty session cookies are now deleted properly automatically.590+- View functions can now opt out of getting the automatic OPTIONS591+ implementation.592+- HTTP exceptions and Bad Request errors can now be trapped so that593+ they show up normally in the traceback.594+- Flask in debug mode is now detecting some common problems and tries595+ to warn you about them.596+- Flask in debug mode will now complain with an assertion error if a597+ view was attached after the first request was handled. This gives598+ earlier feedback when users forget to import view code ahead of599+ time.600+- Added the ability to register callbacks that are only triggered once601+ at the beginning of the first request.602+ (:meth:`Flask.before_first_request`)603+- Malformed JSON data will now trigger a bad request HTTP exception604+ instead of a value error which usually would result in a 500605+ internal server error if not handled. This is a backwards606+ incompatible change.607+- Applications now not only have a root path where the resources and608+ modules are located but also an instance path which is the609+ designated place to drop files that are modified at runtime (uploads610+ etc.). Also this is conceptually only instance depending and outside611+ version control so it's the perfect place to put configuration files612+ etc. For more information see :ref:`instance-folders`.613+- Added the ``APPLICATION_ROOT`` configuration variable.614+- Implemented :meth:`~flask.testing.TestClient.session_transaction` to615+ easily modify sessions from the test environment.616+- Refactored test client internally. The ``APPLICATION_ROOT``617+ configuration variable as well as ``SERVER_NAME`` are now properly618+ used by the test client as defaults.619+- Added :attr:`flask.views.View.decorators` to support simpler620+ decorating of pluggable (class-based) views.621+- Fixed an issue where the test client if used with the "with"622+ statement did not trigger the execution of the teardown handlers.623+- Added finer control over the session cookie parameters.624+- HEAD requests to a method view now automatically dispatch to the625+ ``get`` method if no handler was implemented.626+- Implemented the virtual :mod:`flask.ext` package to import627+ extensions from.628+- The context preservation on exceptions is now an integral component629+ of Flask itself and no longer of the test client. This cleaned up630+ some internal logic and lowers the odds of runaway request contexts631+ in unittests.632+- Fixed the Jinja2 environment's ``list_templates`` method not633+ returning the correct names when blueprints or modules were634+ involved.635 694-Version 0.7.3695--------------636 697-Bugfix release, release date to be decided698-699-- Fixed the Jinja2 environment's list_templates method not returning the700- correct names when blueprints or modules were involved.701-637 Version 0.7.2638 -------------639 705-Bugfix release, released on July 6th 2011640+Released 2011-07-06641 707-- Fixed an issue with URL processors not properly working on708- blueprints.642+- Fixed an issue with URL processors not properly working on643+ blueprints.644 645+646 Version 0.7.1647 -------------648 713-Bugfix release, released on June 29th 2011649+Released 2011-06-29650 715-- Added missing future import that broke 2.5 compatibility.716-- Fixed an infinite redirect issue with blueprints.651+- Added missing future import that broke 2.5 compatibility.652+- Fixed an infinite redirect issue with blueprints.653 654+655 Version 0.7656 -----------657 721-Released on June 28th 2011, codename Grappa658+Released 2011-06-28, codename Grappa659 723-- Added :meth:`~flask.Flask.make_default_options_response`724- which can be used by subclasses to alter the default725- behavior for ``OPTIONS`` responses.726-- Unbound locals now raise a proper :exc:`RuntimeError` instead727- of an :exc:`AttributeError`.728-- Mimetype guessing and etag support based on file objects is now729- deprecated for :func:`flask.send_file` because it was unreliable.730- Pass filenames instead or attach your own etags and provide a731- proper mimetype by hand.732-- Static file handling for modules now requires the name of the733- static folder to be supplied explicitly. The previous autodetection734- was not reliable and caused issues on Google's App Engine. Until735- 1.0 the old behavior will continue to work but issue dependency736- warnings.737-- fixed a problem for Flask to run on jython.738-- added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be739- used to flip the setting of exception propagation which previously740- was linked to ``DEBUG`` alone and is now linked to either ``DEBUG`` or741- ``TESTING``.742-- Flask no longer internally depends on rules being added through the743- `add_url_rule` function and can now also accept regular werkzeug744- rules added to the url map.745-- Added an `endpoint` method to the flask application object which746- allows one to register a callback to an arbitrary endpoint with747- a decorator.748-- Use Last-Modified for static file sending instead of Date which749- was incorrectly introduced in 0.6.750-- Added `create_jinja_loader` to override the loader creation process.751-- Implemented a silent flag for `config.from_pyfile`.752-- Added `teardown_request` decorator, for functions that should run at the end753- of a request regardless of whether an exception occurred. Also the behavior754- for `after_request` was changed. It's now no longer executed when an exception755- is raised. See :ref:`upgrading-to-new-teardown-handling`756-- Implemented :func:`flask.has_request_context`757-- Deprecated `init_jinja_globals`. Override the758- :meth:`~flask.Flask.create_jinja_environment` method instead to759- achieve the same functionality.760-- Added :func:`flask.safe_join`761-- The automatic JSON request data unpacking now looks at the charset762- mimetype parameter.763-- Don't modify the session on :func:`flask.get_flashed_messages` if there764- are no messages in the session.765-- `before_request` handlers are now able to abort requests with errors.766-- it is not possible to define user exception handlers. That way you can767- provide custom error messages from a central hub for certain errors that768- might occur during request processing (for instance database connection769- errors, timeouts from remote resources etc.).770-- Blueprints can provide blueprint specific error handlers.771-- Implemented generic :ref:`views` (class-based views).660+- Added :meth:`~flask.Flask.make_default_options_response` which can661+ be used by subclasses to alter the default behavior for ``OPTIONS``662+ responses.663+- Unbound locals now raise a proper :exc:`RuntimeError` instead of an664+ :exc:`AttributeError`.665+- Mimetype guessing and etag support based on file objects is now666+ deprecated for :func:`flask.send_file` because it was unreliable.667+ Pass filenames instead or attach your own etags and provide a proper668+ mimetype by hand.669+- Static file handling for modules now requires the name of the static670+ folder to be supplied explicitly. The previous autodetection was not671+ reliable and caused issues on Google's App Engine. Until 1.0 the old672+ behavior will continue to work but issue dependency warnings.673+- Fixed a problem for Flask to run on jython.674+- Added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be675+ used to flip the setting of exception propagation which previously676+ was linked to ``DEBUG`` alone and is now linked to either ``DEBUG``677+ or ``TESTING``.678+- Flask no longer internally depends on rules being added through the679+ ``add_url_rule`` function and can now also accept regular werkzeug680+ rules added to the url map.681+- Added an ``endpoint`` method to the flask application object which682+ allows one to register a callback to an arbitrary endpoint with a683+ decorator.684+- Use Last-Modified for static file sending instead of Date which was685+ incorrectly introduced in 0.6.686+- Added ``create_jinja_loader`` to override the loader creation687+ process.688+- Implemented a silent flag for ``config.from_pyfile``.689+- Added ``teardown_request`` decorator, for functions that should run690+ at the end of a request regardless of whether an exception occurred.691+ Also the behavior for ``after_request`` was changed. It's now no692+ longer executed when an exception is raised. See693+ :ref:`upgrading-to-new-teardown-handling`694+- Implemented :func:`flask.has_request_context`695+- Deprecated ``init_jinja_globals``. Override the696+ :meth:`~flask.Flask.create_jinja_environment` method instead to697+ achieve the same functionality.698+- Added :func:`flask.safe_join`699+- The automatic JSON request data unpacking now looks at the charset700+ mimetype parameter.701+- Don't modify the session on :func:`flask.get_flashed_messages` if702+ there are no messages in the session.703+- ``before_request`` handlers are now able to abort requests with704+ errors.705+- It is not possible to define user exception handlers. That way you706+ can provide custom error messages from a central hub for certain707+ errors that might occur during request processing (for instance708+ database connection errors, timeouts from remote resources etc.).709+- Blueprints can provide blueprint specific error handlers.710+- Implemented generic :ref:`views` (class-based views).711 712+713 Version 0.6.1714 -------------715 776-Bugfix release, released on December 31st 2010716+Released 2010-12-31717 778-- Fixed an issue where the default ``OPTIONS`` response was779- not exposing all valid methods in the ``Allow`` header.780-- Jinja2 template loading syntax now allows "./" in front of781- a template load path. Previously this caused issues with782- module setups.783-- Fixed an issue where the subdomain setting for modules was784- ignored for the static folder.785-- Fixed a security problem that allowed clients to download arbitrary files786- if the host server was a windows based operating system and the client787- uses backslashes to escape the directory the files where exposed from.718+- Fixed an issue where the default ``OPTIONS`` response was not719+ exposing all valid methods in the ``Allow`` header.720+- Jinja2 template loading syntax now allows "./" in front of a721+ template load path. Previously this caused issues with module722+ setups.723+- Fixed an issue where the subdomain setting for modules was ignored724+ for the static folder.725+- Fixed a security problem that allowed clients to download arbitrary726+ files if the host server was a windows based operating system and727+ the client uses backslashes to escape the directory the files where728+ exposed from.729 730+731 Version 0.6732 -----------733 792-Released on July 27th 2010, codename Whisky734+Released 2010-07-27, codename Whisky735 794-- after request functions are now called in reverse order of795- registration.796-- OPTIONS is now automatically implemented by Flask unless the797- application explicitly adds 'OPTIONS' as method to the URL rule.798- In this case no automatic OPTIONS handling kicks in.799-- static rules are now even in place if there is no static folder800- for the module. This was implemented to aid GAE which will801- remove the static folder if it's part of a mapping in the .yml802- file.803-- the :attr:`~flask.Flask.config` is now available in the templates804- as `config`.805-- context processors will no longer override values passed directly806- to the render function.807-- added the ability to limit the incoming request data with the808- new ``MAX_CONTENT_LENGTH`` configuration value.809-- the endpoint for the :meth:`flask.Module.add_url_rule` method810- is now optional to be consistent with the function of the811- same name on the application object.812-- added a :func:`flask.make_response` function that simplifies813- creating response object instances in views.814-- added signalling support based on blinker. This feature is currently815- optional and supposed to be used by extensions and applications. If816- you want to use it, make sure to have `blinker`_ installed.817-- refactored the way URL adapters are created. This process is now818- fully customizable with the :meth:`~flask.Flask.create_url_adapter`819- method.820-- modules can now register for a subdomain instead of just an URL821- prefix. This makes it possible to bind a whole module to a822- configurable subdomain.736+- After request functions are now called in reverse order of737+ registration.738+- OPTIONS is now automatically implemented by Flask unless the739+ application explicitly adds 'OPTIONS' as method to the URL rule. In740+ this case no automatic OPTIONS handling kicks in.741+- Static rules are now even in place if there is no static folder for742+ the module. This was implemented to aid GAE which will remove the743+ static folder if it's part of a mapping in the .yml file.744+- The :attr:`~flask.Flask.config` is now available in the templates as745+ ``config``.746+- Context processors will no longer override values passed directly to747+ the render function.748+- Added the ability to limit the incoming request data with the new749+ ``MAX_CONTENT_LENGTH`` configuration value.750+- The endpoint for the :meth:`flask.Module.add_url_rule` method is now751+ optional to be consistent with the function of the same name on the752+ application object.753+- Added a :func:`flask.make_response` function that simplifies754+ creating response object instances in views.755+- Added signalling support based on blinker. This feature is currently756+ optional and supposed to be used by extensions and applications. If757+ you want to use it, make sure to have `blinker`_ installed.758+- Refactored the way URL adapters are created. This process is now759+ fully customizable with the :meth:`~flask.Flask.create_url_adapter`760+ method.761+- Modules can now register for a subdomain instead of just an URL762+ prefix. This makes it possible to bind a whole module to a763+ configurable subdomain.764 765 .. _blinker: https://pypi.org/project/blinker/766 767+768 Version 0.5.2769 -------------770 829-Bugfix Release, released on July 15th 2010771+Released 2010-07-15772 831-- fixed another issue with loading templates from directories when832- modules were used.773+- Fixed another issue with loading templates from directories when774+ modules were used.775 776+777 Version 0.5.1778 -------------779 837-Bugfix Release, released on July 6th 2010780+Released 2010-07-06781 839-- fixes an issue with template loading from directories when modules840- where used.782+- Fixes an issue with template loading from directories when modules783+ where used.784 785+786 Version 0.5787 -----------788 845-Released on July 6th 2010, codename Calvados789+Released 2010-07-06, codename Calvados790 847-- fixed a bug with subdomains that was caused by the inability to848- specify the server name. The server name can now be set with849- the ``SERVER_NAME`` config key. This key is now also used to set850- the session cookie cross-subdomain wide.851-- autoescaping is no longer active for all templates. Instead it852- is only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``.853- Inside templates this behavior can be changed with the854- ``autoescape`` tag.855-- refactored Flask internally. It now consists of more than a856- single file.857-- :func:`flask.send_file` now emits etags and has the ability to858- do conditional responses builtin.859-- (temporarily) dropped support for zipped applications. This was a860- rarely used feature and led to some confusing behavior.861-- added support for per-package template and static-file directories.862-- removed support for `create_jinja_loader` which is no longer used863- in 0.5 due to the improved module support.864-- added a helper function to expose files from any directory.791+- Fixed a bug with subdomains that was caused by the inability to792+ specify the server name. The server name can now be set with the793+ ``SERVER_NAME`` config key. This key is now also used to set the794+ session cookie cross-subdomain wide.795+- Autoescaping is no longer active for all templates. Instead it is796+ only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``. Inside797+ templates this behavior can be changed with the ``autoescape`` tag.798+- Refactored Flask internally. It now consists of more than a single799+ file.800+- :func:`flask.send_file` now emits etags and has the ability to do801+ conditional responses builtin.802+- (temporarily) dropped support for zipped applications. This was a803+ rarely used feature and led to some confusing behavior.804+- Added support for per-package template and static-file directories.805+- Removed support for ``create_jinja_loader`` which is no longer used806+ in 0.5 due to the improved module support.807+- Added a helper function to expose files from any directory.808 809+810 Version 0.4811 -----------812 869-Released on June 18th 2010, codename Rakia813+Released 2010-06-18, codename Rakia814 871-- added the ability to register application wide error handlers872- from modules.873-- :meth:`~flask.Flask.after_request` handlers are now also invoked874- if the request dies with an exception and an error handling page875- kicks in.876-- test client has not the ability to preserve the request context877- for a little longer. This can also be used to trigger custom878- requests that do not pop the request stack for testing.879-- because the Python standard library caches loggers, the name of880- the logger is configurable now to better support unittests.881-- added ``TESTING`` switch that can activate unittesting helpers.882-- the logger switches to ``DEBUG`` mode now if debug is enabled.815+- Added the ability to register application wide error handlers from816+ modules.817+- :meth:`~flask.Flask.after_request` handlers are now also invoked if818+ the request dies with an exception and an error handling page kicks819+ in.820+- Test client has not the ability to preserve the request context for821+ a little longer. This can also be used to trigger custom requests822+ that do not pop the request stack for testing.823+- Because the Python standard library caches loggers, the name of the824+ logger is configurable now to better support unittests.825+- Added ``TESTING`` switch that can activate unittesting helpers.826+- The logger switches to ``DEBUG`` mode now if debug is enabled.827 828+829 Version 0.3.1830 -------------831 887-Bugfix release, released on May 28th 2010832+Released 2010-05-28833 889-- fixed a error reporting bug with :meth:`flask.Config.from_envvar`890-- removed some unused code from flask891-- release does no longer include development leftover files (.git892- folder for themes, built documentation in zip and pdf file and893- some .pyc files)834+- Fixed a error reporting bug with :meth:`flask.Config.from_envvar`835+- Removed some unused code from flask836+- Release does no longer include development leftover files (.git837+ folder for themes, built documentation in zip and pdf file and some838+ .pyc files)839 840+841 Version 0.3842 -----------843 898-Released on May 28th 2010, codename Schnaps844+Released 2010-05-28, codename Schnaps845 900-- added support for categories for flashed messages.901-- the application now configures a :class:`logging.Handler` and will902- log request handling exceptions to that logger when not in debug903- mode. This makes it possible to receive mails on server errors904- for example.905-- added support for context binding that does not require the use of906- the with statement for playing in the console.907-- the request context is now available within the with statement making908- it possible to further push the request context or pop it.909-- added support for configurations.846+- Added support for categories for flashed messages.847+- The application now configures a :class:`logging.Handler` and will848+ log request handling exceptions to that logger when not in debug849+ mode. This makes it possible to receive mails on server errors for850+ example.851+- Added support for context binding that does not require the use of852+ the with statement for playing in the console.853+- The request context is now available within the with statement854+ making it possible to further push the request context or pop it.855+- Added support for configurations.856 857+858 Version 0.2859 -----------860 914-Released on May 12th 2010, codename Jägermeister861+Released 2010-05-12, codename Jägermeister862 916-- various bugfixes917-- integrated JSON support918-- added :func:`~flask.get_template_attribute` helper function.919-- :meth:`~flask.Flask.add_url_rule` can now also register a920- view function.921-- refactored internal request dispatching.922-- server listens on 127.0.0.1 by default now to fix issues with chrome.923-- added external URL support.924-- added support for :func:`~flask.send_file`925-- module support and internal request handling refactoring926- to better support pluggable applications.927-- sessions can be set to be permanent now on a per-session basis.928-- better error reporting on missing secret keys.929-- added support for Google Appengine.863+- Various bugfixes864+- Integrated JSON support865+- Added :func:`~flask.get_template_attribute` helper function.866+- :meth:`~flask.Flask.add_url_rule` can now also register a view867+ function.868+- Refactored internal request dispatching.869+- Server listens on 127.0.0.1 by default now to fix issues with870+ chrome.871+- Added external URL support.872+- Added support for :func:`~flask.send_file`873+- Module support and internal request handling refactoring to better874+ support pluggable applications.875+- Sessions can be set to be permanent now on a per-session basis.876+- Better error reporting on missing secret keys.877+- Added support for Google Appengine.878 879+880 Version 0.1881 -----------882 883+Released 2010-04-16884+934-First public preview release.885+- First public preview release.modified:CONTRIBUTING.rst+13 added-24 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 35 unmodified lines75 pip install -e ".[dev]"76 77 .. _GitHub account: https://github.com/join78 .. _latest version of git: https://git-scm.com/downloads79-.. _username: https://help.github.com/articles/setting-your-username-in-git/80-.. _email: https://help.github.com/articles/setting-your-email-in-git/79+.. _username: https://help.github.com/en/articles/setting-your-username-in-git80+.. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git81 .. _Fork: https://github.com/pallets/flask/fork82-.. _Clone: https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork82+.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork83 84 Start coding85 ~~~~~~~~~~~~86 8 unmodified lines95 96 git checkout -b your-branch-name origin/master97 98 - Using your favorite editor, make your changes, `committing as you go`_.99-- Try to follow `PEP8`_, but you may ignore the line length limit if following100- it would make the code uglier.99+- Try to follow `PEP8`_. We have a pre-commit config and tests that will100+ ensure the code follows our style guide.101 - Include tests that cover any code changes you make. Make sure the test fails102 without your patch. `Run the tests. <contributing-testsuite_>`_.103 - Push your commits to GitHub and `create a pull request`_ by using::104 105 git push --set-upstream origin your-branch-name106 107 - Celebrate 🎉108 109-.. _committing as you go: http://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes109+.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes110 .. _PEP8: https://pep8.org/111-.. _create a pull request: https://help.github.com/articles/creating-a-pull-request/111+.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request112 113 .. _contributing-testsuite:114 115 Running the tests40 unmodified lines156 make html157 158 Open ``_build/html/index.html`` in your browser to view the docs.159 160-Read more about `Sphinx <http://www.sphinx-doc.org>`_.160+Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.161 162 163-make targets164-~~~~~~~~~~~~165-166-Flask provides a ``Makefile`` with various shortcuts. They will ensure that167-all dependencies are installed.168-169-- ``make test`` runs the basic test suite with ``pytest``170-- ``make cov`` runs the basic test suite with ``coverage``171-- ``make test-all`` runs the full test suite with ``tox``172-- ``make docs`` builds the HTML documentation173-163 Caution: zero-padded file modes164 -------------------------------165 166 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-35 removed
1-.PHONY: all install-dev test coverage cov test-all tox docs audit 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-audit:27- python setup.py audit28-29-release:30- python scripts/make-release.py31-32-clean-pyc:33- find . -name '*.pyc' -exec rm -f {} +34- find . -name '*.pyo' -exec rm -f {} +35- 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 $ FLASK_APP=hello.py flask run16 unmodified lines58 -----59 60 * Website: https://www.palletsprojects.com/p/flask/61 * Documentation: http://flask.pocoo.org/docs/62-* License: `BSD <https://github.com/pallets/flask/blob/master/LICENSE>`_62 * Releases: https://pypi.org/project/Flask/63 * Code: https://github.com/pallets/flask64 * Issue tracker: https://github.com/pallets/flask/issues65 * Test status: https://dev.azure.com/pallets/pallets/_build?definitionId=267-* Test coverage: https://codecov.io/gh/pallets/flask66 * Official chat: https://discord.gg/t6rrQZH67 68 .. _WSGI: https://wsgi.readthedocs.io69 .. _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 flask19 .tox/*/lib/python*/site-packages/flask24- .tox/pypy/site-packages/flask20+ .tox/*/site-packages/flaskmodified:setup.py+57 added-62 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 9-with io.open('README.rst', 'rt', encoding='utf8') as f:7+with io.open("README.rst", "rt", encoding="utf8") as f:8 readme = f.read()9 12-with io.open('flask/__init__.py', 'rt', encoding='utf8') as f:13- version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)10+with io.open("flask/__init__.py", "rt", encoding="utf8") as f:11+ version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)12 13 setup(16- name='Flask',14+ name="Flask",15 version=version,18- url='https://www.palletsprojects.com/p/flask/',19- project_urls=OrderedDict((20- ('Documentation', 'http://flask.pocoo.org/docs/'),21- ('Code', 'https://github.com/pallets/flask'),22- ('Issue tracker', 'https://github.com/pallets/flask/issues'),23- )),24- license='BSD',25- author='Armin Ronacher',26- author_email='armin.ronacher@active-4.com',27- maintainer='Pallets team',28- maintainer_email='contact@palletsprojects.com',29- description='A simple framework for building complex web applications.',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",25+ maintainer="Pallets",26+ maintainer_email="contact@palletsprojects.com",27+ description="A simple framework for building complex web applications.",28 long_description=readme,31- packages=['flask', 'flask.json'],29+ classifiers=[30+ "Development Status :: 5 - Production/Stable",31+ "Environment :: Web Environment",32+ "Framework :: Flask",33+ "Intended Audience :: Developers",34+ "License :: OSI Approved :: BSD License",35+ "Operating System :: OS Independent",36+ "Programming Language :: Python",37+ "Programming Language :: Python :: 2",38+ "Programming Language :: Python :: 2.7",39+ "Programming Language :: Python :: 3",40+ "Programming Language :: Python :: 3.4",41+ "Programming Language :: Python :: 3.5",42+ "Programming Language :: Python :: 3.6",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(),49 include_package_data=True,33- zip_safe=False,34- platforms='any',50+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",51 install_requires=[36- 'Werkzeug>=0.14',37- 'Jinja2>=2.10',38- 'itsdangerous>=0.24',39- 'click>=5.1',52+ "Werkzeug>=0.14",53+ "Jinja2>=2.10",54+ "itsdangerous>=0.24",55+ "click>=5.1",56 ],57 extras_require={42- 'dotenv': ['python-dotenv'],43- 'dev': [44- 'pytest>=3',45- 'coverage',46- 'tox',47- 'sphinx',48- 'pallets-sphinx-themes',49- 'sphinxcontrib-log-cabinet',58+ "dotenv": ["python-dotenv"],59+ "dev": [60+ "pytest",61+ "coverage",62+ "tox",63+ "sphinx",64+ "pallets-sphinx-themes",65+ "sphinxcontrib-log-cabinet",66+ "sphinx-issues",67 ],51- 'docs': [52- 'sphinx',53- 'pallets-sphinx-themes',54- 'sphinxcontrib-log-cabinet',55- ]56- },57- classifiers=[58- 'Development Status :: 5 - Production/Stable',59- 'Environment :: Web Environment',60- 'Framework :: Flask',61- 'Intended Audience :: Developers',62- 'License :: OSI Approved :: BSD License',63- 'Operating System :: OS Independent',64- 'Programming Language :: Python',65- 'Programming Language :: Python :: 2',66- 'Programming Language :: Python :: 2.7',67- 'Programming Language :: Python :: 3',68- 'Programming Language :: Python :: 3.4',69- 'Programming Language :: Python :: 3.5',70- 'Programming Language :: Python :: 3.6',71- 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',72- 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',73- 'Topic :: Software Development :: Libraries :: Application Frameworks',74- 'Topic :: Software Development :: Libraries :: Python Modules',75- ],76- entry_points={77- 'console_scripts': [78- 'flask = flask.cli:main',68+ "docs": [69+ "sphinx",70+ "pallets-sphinx-themes",71+ "sphinxcontrib-log-cabinet",72+ "sphinx-issues",73 ],74 },75+ entry_points={"console_scripts": ["flask = flask.cli:main"]},76 )