Skip to content
Myr

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

88 files+983 added−1443 removed

deleted:artwork/LICENSE-20 removed
1Copyright (c) 2010 by Armin Ronacher.23Some rights reserved.45This logo or a modified version may be used by anyone to refer to the6Flask project, but does not indicate endorsement by the project.78Redistribution and use in source (the SVG file) and binary forms (rendered9PNG files etc.) of the image, with or without modification, are permitted10provided that the following conditions are met:1112* Redistributions of source code must retain the above copyright13 notice and this list of conditions.1415* 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.1819Note: we would appreciate that you make the image a link to20http://flask.pocoo.org/ if you use it on a web page.
added:artwork/LICENSE.rst+19 added
1Copyright 2010 Pallets23This logo or a modified version may be used by anyone to refer to the4Flask project, but does not indicate endorsement by the project.56Redistribution and use in source (SVG) and binary (renders in PNG, etc.)7forms, with or without modification, are permitted provided that the8following conditions are met:9101. Redistributions of source code must retain the above copyright11 notice and this list of conditions.12133. 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.1617We would appreciate that you make the image a link to18https://palletsprojects.com/p/flask/ if you use it in a medium that19supports 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 lines
57 RewriteRule ^(.*)$ /path/to/the/application.cgi/$1 [L]5859For more information consult the documentation of your webserver.6061.. _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 lines
16Hosted options17--------------1819- `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/>`_2425Self-hosted options26-------------------
9 unmodified lines
modified:docs/deploying/uwsgi.rst+1 added-1 removed
67 unmodified lines
6869.. _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 lines
42Running `uWSGI HTTP Router`_::4344 uwsgi --http 127.0.0.1:5000 --module myproject:app4546For a more optimized setup, see `configuring uWSGI and NGINX`_.46For a more optimized setup, see :doc:`/deploying/uwsgi`.4748.. _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-router5051Gevent52-------53
30 unmodified lines
84application from ``myproject``::8586 twistd -n web --port tcp:8080 --wsgi myproject.app8789.. _Twisted: https://twistedmatrix.com/88.. _Twisted: https://twistedmatrix.com/trac/89.. _Twisted Web: https://twistedmatrix.com/trac/wiki/TwistedWeb9091.. _deploying-proxy-setups:92
63 unmodified lines
modified:docs/patterns/appfactories.rst+4 added-4 removed
58 unmodified lines
5960It's preferable to create your extensions and app factories so that the61extension object does not initially get bound to the application.6263Using `Flask-SQLAlchemy <http://flask-sqlalchemy.pocoo.org/>`_,63Using `Flask-SQLAlchemy <https://flask-sqlalchemy.palletsprojects.com/>`_,64as an example, you should not do something along those lines::6566 def create_app(config_filename):67 app = Flask(__name__)
24 unmodified lines
92To run such an application, you can use the :command:`flask` command::9394 export FLASK_APP=myapp95 flask run96 97Flask will automatically detect the factory (``create_app`` or ``make_app``) 9697Flask will automatically detect the factory (``create_app`` or ``make_app``)98in ``myapp``. You can also pass arguments to the factory like this::99100 export FLASK_APP="myapp:create_app('dev')"101 flask run102 102103Then the ``create_app`` factory in ``myapp`` is called with the string104``'dev'`` as the argument. See :doc:`/cli` for more detail.105106Factory Improvements
11 unmodified lines
modified:docs/patterns/jquery.rst+2 added-2 removed
9 unmodified lines
10Python primitives (numbers, strings, dicts and lists) look like which is11widely supported and very easy to parse. It became popular a few years12ago and quickly replaced XML as transport format in web applications.1314.. _jQuery: http://jquery.com/14.. _jQuery: https://jquery.com/1516Loading jQuery17--------------18
7 unmodified lines
26 <script type=text/javascript src="{{27 url_for('static', filename='jquery.js') }}"></script>2829Another 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:3132.. sourcecode:: html3334 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
133 unmodified lines
modified:docs/patterns/sqlalchemy.rst+1 added-1 removed
20 unmodified lines
2122You can download `Flask-SQLAlchemy`_ from `PyPI23<https://pypi.org/project/Flask-SQLAlchemy/>`_.2425.. _Flask-SQLAlchemy: http://flask-sqlalchemy.pocoo.org/25.. _Flask-SQLAlchemy: https://flask-sqlalchemy.palletsprojects.com/262728Declarative29-----------
189 unmodified lines
modified:docs/tutorial/deploy.rst+1 added-1 removed
114 unmodified lines
115your application. Waitress is just an example, chosen for the tutorial116because it supports both Windows and Linux. There are many more WSGI117servers and deployment options that you may choose for your project.118119.. _Waitress: https://docs.pylonsproject.org/projects/waitress/119.. _Waitress: https://docs.pylonsproject.org/projects/waitress/en/stable/120121Continue to :doc:`next`.
modified:docs/tutorial/install.rst+1 added-1 removed
68 unmodified lines
6970See the `official packaging guide`_ for another explanation of the files71and options used.7273.. _official packaging guide: https://packaging.python.org/tutorials/distributing-packages/73.. _official packaging guide: https://packaging.python.org/tutorials/packaging-projects/747576Install the Project77-------------------
37 unmodified lines
modified:docs/api.rst+3 added-3 removed
41 unmodified lines
42 .. attribute:: url43 .. attribute:: base_url44 .. attribute:: url_root4546 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::4950 http://www.example.com/myapplication5152 And a user requests the following URI::
781 unmodified lines
modified:docs/becomingbig.rst+1 added-1 removed
42 unmodified lines
43The :ref:`app-dispatch` chapter shows in detail how to apply middleware. You44can introduce WSGI middleware to wrap your Flask instances and introduce fixes45and changes at the layer between your Flask application and your HTTP46server. Werkzeug includes several `middlewares47<http://werkzeug.pocoo.org/docs/middlewares/>`_.47<https://werkzeug.palletsprojects.com/middleware/>`_.4849Fork.50-----51
50 unmodified lines
modified:docs/changelog.rst+3 added
1Changelog2=========34.. include:: ../CHANGES.rst
modified:docs/cli.rst+3 added-3 removed
8 unmodified lines
9interface, in your virtualenv. Executed from the terminal, this script gives10access to built-in, extension, and application-defined commands. The ``--help``11option will give more information about any commands and options.1213.. _Click: http://click.pocoo.org/13.. _Click: https://click.palletsprojects.com/141516Application Discovery17---------------------
321 unmodified lines
339 },340 )341342343.. _entry point: https://packaging.python.org/tutorials/distributing-packages/#entry-points343.. _entry point: https://packaging.python.org/tutorials/packaging-projects/#entry-points344345Inside :file:`flask_my_extension/commands.py` you can then export a Click346object::347
60 unmodified lines
408409 The ``flask`` command, being separate from your code, does not have410 this issue and is recommended in most cases.411412.. _console script: https://packaging.python.org/tutorials/distributing-packages/#console-scripts412.. _console script: https://packaging.python.org/tutorials/packaging-projects/#console-scripts413414415PyCharm Integration416-------------------
50 unmodified lines
modified:docs/conf.py+10 added-19 removed
1# -*- coding: utf-8 -*-2from __future__ import print_function1from pallets_sphinx_themes import get_version2from pallets_sphinx_themes import ProjectLink34from pallets_sphinx_themes import ProjectLink, get_version54# Project --------------------------------------------------------------56project = "Flask"9copyright = "2010 Pallets Team"10author = "Pallets Team"7copyright = "2010 Pallets"8author = "Pallets"9release, version = get_version("Flask")1011# General --------------------------------------------------------------12
2 unmodified lines
15 "sphinx.ext.autodoc",16 "sphinx.ext.intersphinx",17 "sphinxcontrib.log_cabinet",18 "pallets_sphinx_themes",19 "sphinx_issues",20]21intersphinx_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}31issues_github_path = "pallets/flask"3233# HTML -----------------------------------------------------------------3435html_theme = "flask"
12 unmodified lines
48 "**": ["localtoc.html", "relations.html", "searchbox.html"],49}50singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}51html_static_path = ["_static"]52html_favicon = "_static/flask-favicon.ico"53html_logo = "_static/flask.png"52html_favicon = "_static/flask-icon.png"53html_logo = "_static/flask-icon.png"54html_title = "Flask Documentation ({})".format(version)55html_show_sourcelink = False5657# LaTeX ----------------------------------------------------------------5859latex_documents = [60 (master_doc, "Flask.tex", "Flask Documentation", "Pallets Team", "manual")60 (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")61]62latex_use_modindex = False63latex_elements = {64 "papersize": "a4paper",65 "pointsize": "12pt",66 "fontpkg": r"\usepackage{mathpazo}",67 "preamble": r"\usepackage{flaskstyle}",68}69latex_use_parts = True70latex_additional_files = ["flaskstyle.sty", "logo.pdf"]6263# Local Extensions -----------------------------------------------------6465
30 unmodified lines
deleted:docs/contents.rst.inc-62 removed
1User's Guide2------------34This part of the documentation, which is mostly prose, begins with some5background information about Flask, then focuses on step-by-step6instructions for web development with Flask.78.. toctree::9 :maxdepth: 21011 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 becomingbig3334API Reference35-------------3637If you are looking for information on a specific function, class or38method, this part of the documentation is for you.3940.. toctree::41 :maxdepth: 24243 api4445Additional Notes46----------------4748Design notes, legal information and changelog are here for the interested.4950.. toctree::51 :maxdepth: 25253 design54 htmlfaq55 security56 unicode57 extensiondev58 styleguide59 upgrading60 changelog61 license62 contributing
modified:docs/errorhandling.rst+2 added-2 removed
32 unmodified lines
3334Sending error mails, even if just for critical ones, can become35overwhelming if enough users are hitting the error and log files are36typically 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's38available 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. Sentry41aggregates duplicate errors, captures the full stack trace and local42variables for debugging, and sends you mails based on new errors or43frequency thresholds.44
171 unmodified lines
modified:docs/extensiondev.rst+5 added-6 removed
2 unmodified lines
3Flask Extension Development4===========================56Flask, being a microframework, often requires some repetitive steps to get7a third party library working. Because very often these steps could be8abstracted to support multiple projects the `Flask Extension Registry`_9was created.7a third party library working. Many such extensions are already available8on `PyPI <https://pypi.org/search/?c=Framework+%3A%3A+Flask>`_.910If you want to create your own Flask extension for something that does not11exist yet, this guide to extension development will help you get your12extension running in no time and to feel like users would expect your
313 unmodified lines
326 *ExtensionName-Flask*.3276. 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.3317. The documentation must use the ``flask`` theme from the `Official332 Pallets Themes`_.3307. The documentation must use the ``flask`` theme from the331 `Official Pallets Themes`_.3328. 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 lines
340341.. _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}34% Replace Unicode character 'PARTY POPPER' (U+1F389) with a non-breaking space.5% pdfLaTeX doesn't support Unicode.6\DeclareUnicodeCharacter{1F389}{\nobreakspace}78\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}4748\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}5758\fancypagestyle{plain}{59 \fancyhf{}60 \fancyfoot[LE,RO]{{\thepage}}61 \renewcommand{\headrulewidth}{0pt}62 \renewcommand{\footrulewidth}{0.4pt}63}6465\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}7374\ChNameVar{\raggedleft\normalsize}75\ChNumVar{\raggedleft \bfseries\Large}76\ChTitleVar{\raggedleft \rm\Huge}7778\renewcommand\thepart{\@Roman\c@part}79\renewcommand\part{%80 \pagestyle{plain}81 \if@noskipsec \leavevmode \fi82 \cleardoublepage83 \vspace*{6cm}%84 \@afterindentfalse85 \secdef\@part\@spart}8687\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}114115% use inconsolata font116\usepackage{inconsolata}117118% fix single quotes, for inconsolata. (does not work)119%%\usepackage{textcomp}120%%\begingroup121%% \catcode`'=\active122%% \g@addto@macro\@noligs{\let'\textsinglequote}123%% \endgroup124%%\endinput
modified:docs/htmlfaq.rst+1 added-1 removed
184 unmodified lines
185Many other features have been added, as well. A good guide to new features186in HTML5 is Mark Pilgrim's soon-to-be-published book, `Dive Into HTML5`_.187Not all of them are supported in browsers yet, however, so use caution.188189.. _Dive Into HTML5: http://diveintohtml5.info/189.. _Dive Into HTML5: https://diveintohtml5.info/190191What should be used?192--------------------193
14 unmodified lines
modified:docs/index.rst+67 added-3 removed
1 unmodified line
23Welcome to Flask4================56.. 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 lines
18Flask depends on the `Jinja`_ template engine and the `Werkzeug`_ WSGI19toolkit. The documentation for these libraries can be found at:2021- `Jinja documentation <http://jinja.pocoo.org/docs>`_22- `Werkzeug documentation <http://werkzeug.pocoo.org/docs>`_22- `Werkzeug documentation <https://werkzeug.palletsprojects.com/>`_2324.. _Jinja: https://www.palletsprojects.com/p/jinja/25.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/2627.. include:: contents.rst.inc2728User's Guide29------------3031This part of the documentation, which is mostly prose, begins with some32background information about Flask, then focuses on step-by-step33instructions for web development with Flask.3435.. toctree::36 :maxdepth: 23738 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 becomingbig606162API Reference63-------------6465If you are looking for information on a specific function, class or66method, this part of the documentation is for you.6768.. toctree::69 :maxdepth: 27071 api727374Additional Notes75----------------7677Design notes, legal information and changelog are here for the interested.7879.. toctree::80 :maxdepth: 28182 design83 htmlfaq84 security85 unicode86 extensiondev87 styleguide88 upgrading89 changelog90 license91 contributing
modified:docs/installation.rst+5 added-5 removed
23 unmodified lines
24 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.2728.. _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/3334Optional dependencies35~~~~~~~~~~~~~~~~~~~~~36
150 unmodified lines
deleted:docs/latexindex.rst-6 removed
1:orphan:23Flask Documentation4===================56.. include:: contents.rst.inc
modified:docs/license.rst+10 added-39 removed
1License2=======34Flask is licensed under a three clause BSD License. It basically means:5do whatever you want with it as long as the copyright in Flask sticks6around, the conditions are not modified and the disclaimer is present.7Furthermore you must not use the names of the authors to promote derivatives8of the software without written consent.4Source License5--------------610The full license text can be found below (:ref:`flask-license`). For the11documentation and artwork different licenses apply.7This license applies to all files in the Flask repository and source8distribution. This includes Flask's source code, the examples, and9tests, as well as the documentation.1013.. _authors:11.. include:: ../LICENSE.rst1215Authors16-------1318.. include:: ../AUTHORS14Artwork License15---------------1620General License Definitions21---------------------------17This license applies to Flask's logo.1823The following section contains the full license texts for Flask and the24documentation.2526- "AUTHORS" hereby refers to all the authors listed in the27 :ref:`authors` section.2829- 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.3233- The ":ref:`artwork-license`" applies to the project's Horn-Logo.3435.. _flask-license:3637Flask License38-------------3940.. include:: ../LICENSE414243.. _artwork-license:4445Flask Artwork License46---------------------4748.. include:: ../artwork/LICENSE19.. include:: ../artwork/LICENSE.rst
deleted:docs/logo.pdfbinary

A binary file, deleted.

modified:docs/make.bat+35 added-36 removed
1@ECHO OFF23pushd %~dp045REM Command file for Sphinx documentation67if "%SPHINXBUILD%" == "" (8 set SPHINXBUILD=sphinx-build9)10set SOURCEDIR=.11set BUILDDIR=_build12set SPHINXPROJ=Flask1314if "%1" == "" goto help1516%SPHINXBUILD% >NUL 2>NUL17if 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)2829%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30goto end3132:help33%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%3435:end36popd1@ECHO OFF23pushd %~dp045REM Command file for Sphinx documentation67if "%SPHINXBUILD%" == "" (8 set SPHINXBUILD=sphinx-build9)10set SOURCEDIR=.11set BUILDDIR=_build1213if "%1" == "" goto help1415%SPHINXBUILD% >NUL 2>NUL16if 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)2728%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%29goto end3031:help32%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%3334:end35popd
modified:docs/Makefile+1 added-2 removed
2 unmodified lines
34# You can set these variables from the command line.5SPHINXOPTS =6SPHINXBUILD = sphinx-build7SPHINXPROJ = Flask7SOURCEDIR = .8BUILDDIR = _build910# Put it first so that "make" without argument is like "make help".
4 unmodified lines
1516# 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 lines
68This launches a very simple builtin server, which is good enough for testing69but probably not what you want to use in production. For deployment options see70:ref:`deployment`.7172Now head over to `http://127.0.0.1:5000/ <http://127.0.0.1:5000/>`_, and you73should see your hello world greeting.72Now head over to http://127.0.0.1:5000/, and you should see your hello73world greeting.7475.. _public-server:7677.. admonition:: Externally Visible Server
88 unmodified lines
166167More information on using the debugger can be found in the `Werkzeug168documentation`_.169170.. _Werkzeug documentation: http://werkzeug.pocoo.org/docs/debug/#using-the-debugger170.. _Werkzeug documentation: https://werkzeug.palletsprojects.com/debug/#using-the-debugger171172Have another debugger in mind? See :ref:`working-with-debuggers`.173174
208 unmodified lines
383 /hello.html384385For templates you can use the full power of Jinja2 templates. Head over386to the official `Jinja2 Template Documentation387<http://jinja.pocoo.org/docs/templates>`_ for more information.387<http://jinja.pocoo.org/docs/templates/>`_ for more information.388389Here is an example template:390391.. sourcecode:: html+jinja
426 unmodified lines
818 app.logger.warning('A warning occurred (%d apples)', 42)819 app.logger.error('An error occurred')820821The attached :attr:`~flask.Flask.logger` is a standard logging822:class:`~logging.Logger`, so head over to the official `logging823documentation <https://docs.python.org/library/logging.html>`_ for more824information.822:class:`~logging.Logger`, so head over to the official :mod:`logging`823docs for more information.824825Read more on :ref:`application-errors`.826827Hooking in WSGI Middlewares
23 unmodified lines
modified:docs/requirements.txt+3 added-2 removed
1Sphinx~=1.8.02Pallets-Sphinx-Themes~=1.1.01Sphinx~=2.1.22Pallets-Sphinx-Themes~=1.1.43sphinxcontrib-log-cabinet~=1.0.04sphinx-issues~=1.2.0
modified:docs/templating.rst+1 added-1 removed
9 unmodified lines
1011This section only gives a very quick introduction into how Jinja212is integrated into Flask. If you want information on the template13engine's syntax itself, head over to the official `Jinja2 Template14Documentation <http://jinja.pocoo.org/docs/templates>`_ for14Documentation <http://jinja.pocoo.org/docs/templates/>`_ for15more information.1617Jinja Setup18-----------
218 unmodified lines
modified:docs/testing.rst+3 added-4 removed
18 unmodified lines
19framework for our tests. You can install it with ``pip``, like so::2021 pip install pytest2223.. _pytest:24 https://pytest.org23.. _pytest: https://docs.pytest.org/2425The Application26---------------27
423 unmodified lines
451 def test_hello_params():452 context = hello_command.make_context('hello', ['--name', 'flask'])453 assert context.params['name'] == 'FLASK'454456.. _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 lines
5text. Not only these libraries, also the majority of web related Python6libraries that deal with text. If you don't know Unicode so far, you7should probably read `The Absolute Minimum Every Software Developer8Absolutely, Positively Must Know About Unicode and Character Sets9<http://www.joelonsoftware.com/articles/Unicode.html>`_. This part of the10documentation just tries to cover the very basics so that you have a11pleasant 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/>`_.10This part of the documentation just tries to cover the very basics so11that you have a pleasant experience with Unicode related things.1213Automatic Conversion14--------------------15
92 unmodified lines
modified:flask/json/__init__.py+2 added-2 removed
1 unmodified line
2"""3flask.json4~~~~~~~~~~56:copyright: © 2010 by the Pallets team.7:license: BSD, see LICENSE for more details.6:copyright: 2010 Pallets7:license: BSD-3-Clause8"""9import codecs10import io11import uuid
346 unmodified lines
modified:flask/json/tag.py+2 added-2 removed
36 unmodified lines
37 return OrderedDict(value)3839 app.session_interface.serializer.register(TagOrderedDict, index=0)4041:copyright: © 2010 by the Pallets team.42:license: BSD, see LICENSE for more details.41:copyright: 2010 Pallets42:license: BSD-3-Clause43"""4445from base64 import b64decode, b64encode46from datetime import datetime
254 unmodified lines
modified:flask/__init__.py+2 added-2 removed
4 unmodified lines
56 A microframework based on Werkzeug. It's extensively documented7 and follows best practice patterns.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""1213__version__ = '1.0.3'14
35 unmodified lines
modified:flask/__main__.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~56 Alias for flask.run for the command line.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112if __name__ == '__main__':13 from .cli import main
1 unmodified line
modified:flask/_compat.py+2 added-2 removed
5 unmodified lines
6 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.910 :copyright: © 2010 by the Pallets team.11 :license: BSD, see LICENSE for more details.10 :copyright: 2010 Pallets11 :license: BSD-3-Clause12"""1314import sys15
86 unmodified lines
modified:flask/app.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~56 This module implements the central WSGI application object.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import os13import sys
2327 unmodified lines
modified:flask/blueprints.py+2 added-2 removed
4 unmodified lines
56 Blueprints are the recommended way to implement larger or more7 pluggable applications in Flask 0.7 and later.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""12from functools import update_wrapper1314from .helpers import _PackageBoundObject, _endpoint_from_view_func
471 unmodified lines
modified:flask/cli.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~56 A simple command line application to run flask apps.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112from __future__ import print_function13
897 unmodified lines
modified:flask/config.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~56 Implements the configuration related objects.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import os13import types
256 unmodified lines
modified:flask/ctx.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~56 Implements the objects required to keep the context.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import sys13from functools import update_wrapper
444 unmodified lines
modified:flask/debughelpers.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~~~56 Various helpers to make the development experience better.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import os13from warnings import warn
155 unmodified lines
modified:flask/globals.py+2 added-2 removed
4 unmodified lines
56 Defines all the global objects that are proxies to the current7 active context.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""1213from functools import partial14from werkzeug.local import LocalStack, LocalProxy
47 unmodified lines
modified:flask/helpers.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~56 Implements various helpers.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import os13import socket
1038 unmodified lines
modified:flask/logging.py+2 added-2 removed
1 unmodified line
2"""3flask.logging4~~~~~~~~~~~~~56:copyright: © 2010 by the Pallets team.7:license: BSD, see LICENSE for more details.6:copyright: 2010 Pallets7:license: BSD-3-Clause8"""910from __future__ import absolute_import11
67 unmodified lines
modified:flask/sessions.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~56 Implements cookie based sessions based on itsdangerous.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import hashlib13import warnings
372 unmodified lines
modified:flask/signals.py+2 added-2 removed
4 unmodified lines
56 Implements signals based on blinker if available, otherwise7 falls silently back to a noop.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""1213signals_available = False14try:
43 unmodified lines
modified:flask/templating.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~56 Implements the bridge to Jinja2.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112from jinja2 import BaseLoader, Environment as BaseEnvironment, \13 TemplateNotFound
137 unmodified lines
modified:flask/testing.py+2 added-2 removed
4 unmodified lines
56 Implements test support helpers. This module is lazily imported7 and usually not used in production environments.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""1213import werkzeug14from contextlib import contextmanager
232 unmodified lines
modified:flask/views.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~56 This module provides class-based views inspired by the ones in Django.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112from .globals import request13from ._compat import with_metaclass
145 unmodified lines
modified:flask/wrappers.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~56 Implements the WSGI wrappers (request and response).78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112from werkzeug.exceptions import BadRequest13from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
203 unmodified lines
deleted:scripts/make-release.py-164 removed
1#!/usr/bin/env python2from __future__ import print_function34import os5import re6import sys7from datetime import date, datetime8from subprocess import PIPE, Popen910_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')111213def 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())1819 if match is None:20 continue2122 version = match.group(1).strip()2324 if next(lineiter).count('-') != len(match.group(0)):25 continue2627 while 1:28 change_info = next(lineiter).strip()2930 if change_info:31 break3233 match = re.search(34 r'released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?',35 change_info,36 flags=re.IGNORECASE37 )3839 if match is None:40 continue4142 datestr, codename = match.groups()43 return version, parse_date(datestr), codename444546def bump_version(version):47 try:48 parts = [int(i) for i in version.split('.')]49 except ValueError:50 fail('Current version is not numeric')5152 parts[-1] += 153 return '.'.join(map(str, parts))545556def parse_date(string):57 string = _date_strip_re.sub('', string)58 return datetime.strptime(string, '%B %d %Y')596061def set_filename_version(filename, version_number, pattern):62 changed = []6364 def inject_version(match):65 before, old, after = match.groups()66 changed.append(True)67 return before + version_number + after6869 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 )7576 if not changed:77 fail('Could not find %s in %s', pattern, filename)7879 with open(filename, 'w') as f:80 f.write(contents)818283def set_init_version(version):84 info('Setting __init__.py version to %s', version)85 set_filename_version('flask/__init__.py', version, '__version__')868788def build():89 cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel']90 Popen(cmd).wait()919293def fail(message, *args):94 print('Error:', message % args, file=sys.stderr)95 sys.exit(1)969798def info(message, *args):99 print(message % args, file=sys.stderr)100101102def get_git_tags():103 return set(104 Popen(['git', 'tag'], stdout=PIPE).communicate()[0].splitlines()105 )106107108def git_is_clean():109 return Popen(['git', 'diff', '--quiet']).wait() == 0110111112def make_git_commit(message, *args):113 message = message % args114 Popen(['git', 'commit', '-am', message]).wait()115116117def make_git_tag(tag):118 info('Tagging "%s"', tag)119 Popen(['git', 'tag', tag]).wait()120121122def main():123 os.chdir(os.path.join(os.path.dirname(__file__), '..'))124125 rv = parse_changelog()126127 if rv is None:128 fail('Could not parse changelog')129130 version, release_date, codename = rv131 dev_version = bump_version(version) + '.dev'132133 info(134 'Releasing %s (codename %s, release date %s)',135 version, codename, release_date.strftime('%d/%m/%Y')136 )137 tags = get_git_tags()138139 if version in tags:140 fail('Version "%s" is already tagged', version)141142 if release_date.date() != date.today():143 fail(144 'Release date is not today (%s != %s)',145 release_date.date(), date.today()146 )147148 if not git_is_clean():149 fail('You have uncommitted changes in git')150151 try:152 import wheel # noqa: F401153 except ImportError:154 fail('You need to install the wheel package.')155156 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)161162163if __name__ == '__main__':164 main()
modified:tests/conftest.py+2 added-2 removed
1 unmodified line
2"""3 tests.conftest4 ~~~~~~~~~~~~~~56 :copyright: © 2010 by the Pallets team.7 :license: BSD, see LICENSE for more details.6 :copyright: 2010 Pallets7 :license: BSD-3-Clause8"""910import gc11import os
187 unmodified lines
modified:tests/test_appctx.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~56 Tests the application context.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import pytest13
206 unmodified lines
modified:tests/test_basic.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~~~~~~56 The basic functionality.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import re13import time
1935 unmodified lines
modified:tests/test_blueprints.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~56 Blueprints (and currently modules)78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import functools13import pytest
843 unmodified lines
modified:tests/test_cli.py+2 added-2 removed
1 unmodified line
2"""3 tests.test_cli4 ~~~~~~~~~~~~~~56 :copyright: © 2010 by the Pallets team.7 :license: BSD, see LICENSE for more details.6 :copyright: 2010 Pallets7 :license: BSD-3-Clause8"""910# This file was part of Flask-CLI and was modified under the terms of11# its Revised BSD License. Copyright © 2015 CERN.
566 unmodified lines
modified:tests/test_config.py+2 added-2 removed
1 unmodified line
2"""3 tests.test_config4 ~~~~~~~~~~~~~~~~~56 :copyright: © 2010 by the Pallets team.7 :license: BSD, see LICENSE for more details.6 :copyright: 2010 Pallets7 :license: BSD-3-Clause8"""910from datetime import timedelta11import os
196 unmodified lines
modified:tests/test_helpers.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~~~~~~~~56 Various helpers.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import datetime13import os
943 unmodified lines
modified:tests/test_instance_config.py+2 added-2 removed
1 unmodified line
2"""3 tests.test_instance4 ~~~~~~~~~~~~~~~~~~~56 :copyright: © 2010 by the Pallets team.7 :license: BSD, see LICENSE for more details.6 :copyright: 2010 Pallets7 :license: BSD-3-Clause8"""910import os11import sys
124 unmodified lines
modified:tests/test_json_tag.py+2 added-2 removed
1 unmodified line
2"""3tests.test_json_tag4~~~~~~~~~~~~~~~~~~~56:copyright: © 2010 by the Pallets team.7:license: BSD, see LICENSE for more details.6:copyright: 2010 Pallets7:license: BSD-3-Clause8"""910from datetime import datetime11from uuid import uuid4
79 unmodified lines
modified:tests/test_logging.py+2 added-2 removed
1 unmodified line
2"""3tests.test_logging4~~~~~~~~~~~~~~~~~~~56:copyright: © 2010 by the Pallets team.7:license: BSD, see LICENSE for more details.6:copyright: 2010 Pallets7:license: BSD-3-Clause8"""910import logging11import sys
96 unmodified lines
modified:tests/test_regression.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~56 Tests regressions.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import gc13import sys
86 unmodified lines
modified:tests/test_reqctx.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~56 Tests the request context.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import pytest13
209 unmodified lines
modified:tests/test_signals.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~~~~~~~~56 Signalling.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import pytest13
190 unmodified lines
modified:tests/test_subclassing.py+2 added-2 removed
4 unmodified lines
56 Test that certain behavior of flask can be customized by7 subclasses.89 :copyright: © 2010 by the Pallets team.10 :license: BSD, see LICENSE for more details.9 :copyright: 2010 Pallets10 :license: BSD-3-Clause11"""1213import flask14
19 unmodified lines
modified:tests/test_templating.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~~~~56 Template functionality78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import pytest13
430 unmodified lines
modified:tests/test_testing.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~~~56 Test client and more.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""11import click12import pytest13
400 unmodified lines
modified:tests/test_user_error_handler.py+2 added-2 removed
1 unmodified line
2"""3tests.test_user_error_handler4~~~~~~~~~~~~~~~~~~~~~~~~~~~~~56:copyright: © 2010 by the Pallets team.7:license: BSD, see LICENSE for more details.6:copyright: 2010 Pallets7:license: BSD-3-Clause8"""910from werkzeug.exceptions import (11 Forbidden,
188 unmodified lines
modified:tests/test_views.py+2 added-2 removed
3 unmodified lines
4 ~~~~~~~~~~~56 Pluggable views.78 :copyright: © 2010 by the Pallets team.9 :license: BSD, see LICENSE for more details.8 :copyright: 2010 Pallets9 :license: BSD-3-Clause10"""1112import pytest13
226 unmodified lines
deleted:AUTHORS-12 removed
1Flask is developed and maintained by the Pallets team and community2contributors. It was created by Armin Ronacher. The core maintainers3are:45- David Lord (davidism)6- Adrian Mönnich (ThiefMaster)7- Armin Ronacher (mitsuhiko)8- Marcus Unterwaditzer (untitaker)910A full list of contributors is available from git with::1112 git shortlog -sne
modified:CHANGES.rst+601 added-650 removed
1.. currentmodule:: flask23Flask Changelog4===============563Version 1.0.34-------------56Released 2019-05-1778- :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`2429.. _#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/2986253626Version 1.0.227-------------2829Released 2018-05-023031- 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`3547.. _#2748: https://github.com/pallets/flask/pull/274848.. _#2751: https://github.com/pallets/flask/issues/2751365037Version 1.0.138-------------3940Released 2018-04-294142- 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`5469.. _#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/2742557656Version 1.057-----------5859Released 2018-04-266082- **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`152153 - ``flask.ext`` - import extensions directly by their name instead154 of through the ``flask.ext`` namespace. For example,155 ``import flask.ext.sqlalchemy`` becomes
9 unmodified lines
165 instead.166 - ``Request.module`` - use :attr:`Request.blueprint` instead.167168- 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`215238.. _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/2709216287217Version 0.12.4218--------------219291Released on April 29 2018220Released 2018-04-29221293- Repackage 0.12.3 to fix package layout issue. (`#2728`_)222- Repackage 0.12.3 to fix package layout issue. :issue:`2728`223295.. _#2728: https://github.com/pallets/flask/issues/2728224297225Version 0.12.3226--------------227301Released on April 26th 2018228Released 2018-04-26229230- :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.237311.. _#2666: https://github.com/pallets/flask/issues/2666312.. _#2692: https://github.com/pallets/flask/issues/2692238314239Version 0.12.2240--------------241318Released on May 16 2017242Released 2017-05-16243320- Fix a bug in `safe_join` on Windows.244- Fix a bug in ``safe_join`` on Windows.245246247Version 0.12.1248--------------249325Bugfix release, released on March 31st 2017250Released 2017-03-31251327- 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.261262263Version 0.12264------------265340Released on December 21st 2016, codename Punsch.266Released 2016-12-21, codename Punsch267342- 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`284358Version 0.11.2359--------------285361Bugfix release, unreleased362363- Fix crash when running under PyPy3, see pull request ``#1814``.364286Version 0.11.1287--------------288368Bugfix release, released on June 7th 2016.289Released 2016-06-07290370- 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`293294295Version 0.11296------------297376Released on May 29th 2016, codename Absinthe.298Released 2016-05-29, codename Absinthe299378- 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``.393442- ``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.394452Version 0.10.2453--------------454455(bugfix release, release date to be announced)456457- 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`.474395Version 0.10.1396--------------397478(bugfix release, released on June 14th 2013)398Released 2013-06-14399480- 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.409410411Version 0.10412------------413493Released on June 13th 2013, codename Limoncello.414Released 2013-06-13, codename Limoncello415495- 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.490491492Version 0.9493-----------494570Released on July 1st 2012, codename Campari.495Released 2012-07-01, codename Campari496572- 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.569570571Version 0.8.1572-------------573641Bugfix release, released on July 1st 2012574Released 2012-07-01575643- 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.579580581Version 0.8582-----------583650Released on September 29th 2011, codename Rakija584Released 2011-09-29, codename Rakija585652- 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.635694Version 0.7.3695-------------636697Bugfix release, release date to be decided698699- Fixed the Jinja2 environment's list_templates method not returning the700 correct names when blueprints or modules were involved.701637Version 0.7.2638-------------639705Bugfix release, released on July 6th 2011640Released 2011-07-06641707- Fixed an issue with URL processors not properly working on708 blueprints.642- Fixed an issue with URL processors not properly working on643 blueprints.644645646Version 0.7.1647-------------648713Bugfix release, released on June 29th 2011649Released 2011-06-29650715- 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.653654655Version 0.7656-----------657721Released on June 28th 2011, codename Grappa658Released 2011-06-28, codename Grappa659723- 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).711712713Version 0.6.1714-------------715776Bugfix release, released on December 31st 2010716Released 2010-12-31717778- 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.729730731Version 0.6732-----------733792Released on July 27th 2010, codename Whisky734Released 2010-07-27, codename Whisky735794- 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.764765.. _blinker: https://pypi.org/project/blinker/766767768Version 0.5.2769-------------770829Bugfix Release, released on July 15th 2010771Released 2010-07-15772831- 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.775776777Version 0.5.1778-------------779837Bugfix Release, released on July 6th 2010780Released 2010-07-06781839- 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.784785786Version 0.5787-----------788845Released on July 6th 2010, codename Calvados789Released 2010-07-06, codename Calvados790847- 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.808809810Version 0.4811-----------812869Released on June 18th 2010, codename Rakia813Released 2010-06-18, codename Rakia814871- 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.827828829Version 0.3.1830-------------831887Bugfix release, released on May 28th 2010832Released 2010-05-28833889- 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)839840841Version 0.3842-----------843898Released on May 28th 2010, codename Schnaps844Released 2010-05-28, codename Schnaps845900- 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.856857858Version 0.2859-----------860914Released on May 12th 2010, codename Jägermeister861Released 2010-05-12, codename Jägermeister862916- 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.878879880Version 0.1881-----------882883Released 2010-04-16884934First public preview release.885- First public preview release.
modified:CONTRIBUTING.rst+13 added-24 removed
7 unmodified lines
89Please, don't use the issue tracker for this. Use one of the following10resources for questions about your own code:1112* The ``#get-help`` channel on our Discord chat: https://discord.gg/t6rrQZH12* The ``#get-help`` channel on our Discord chat: https://discordapp.com/invite/t6rrQZH1314 * The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but15 Discord is preferred.16
6 unmodified lines
23Reporting issues24----------------2526- 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.3435.. _minimal, complete, and verifiable example: https://stackoverflow.com/help/mcve35.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example3637Submitting patches38------------------39
35 unmodified lines
75 pip install -e ".[dev]"7677.. _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-fork8384Start coding85~~~~~~~~~~~~86
8 unmodified lines
9596 git checkout -b your-branch-name origin/master9798- 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::104105 git push --set-upstream origin your-branch-name106107- Celebrate 🎉108109.. _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-request112113.. _contributing-testsuite:114115Running the tests
40 unmodified lines
156 make html157158Open ``_build/html/index.html`` in your browser to view the docs.159160Read more about `Sphinx <http://www.sphinx-doc.org>`_.160Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.161162163make targets164~~~~~~~~~~~~165166Flask provides a ``Makefile`` with various shortcuts. They will ensure that167all dependencies are installed.168169- ``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 documentation173163Caution: zero-padded file modes164-------------------------------165166This repository contains several zero-padded file modes that may cause issues
18 unmodified lines
deleted:LICENSE-31 removed
1Copyright © 2010 by the Pallets team.23Some rights reserved.45Redistribution and use in source and binary forms of the software as6well as documentation, with or without modification, are permitted7provided that the following conditions are met:89* Redistributions of source code must retain the above copyright notice,10 this list of conditions and the following disclaimer.1112* 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.1516* 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.1920THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND21CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,22BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND23FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE24COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,25INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT26NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF27USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON28ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF30THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF31SUCH DAMAGE.
added:LICENSE.rst+28 added
1Copyright 2010 Pallets23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are5met:671. Redistributions of source code must retain the above copyright8 notice, this list of conditions and the following disclaimer.9102. 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.13143. 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.1718THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28SOFTWARE, 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 ebook23all: test45install-dev:6 pip install -q -e .[dev]78test: clean-pyc install-dev9 pytest1011coverage: clean-pyc install-dev12 coverage run -m pytest13 coverage report14 coverage html1516cov: coverage1718test-all: install-dev19 tox2021tox: test-all2223docs: clean-pyc install-dev24 $(MAKE) -C docs html2526audit:27 python setup.py audit2829release:30 python scripts/make-release.py3132clean-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
1include Makefile CHANGES.rst CONTRIBUTING.rst LICENSE AUTHORS tox.ini21include CHANGES.rst2include CONTRIBUTING.rst3include tox.ini4graft artwork4graft tests5graft examples5graft docs78global-exclude *.py[co]96prune docs/_build11prune docs/_themes7graft examples8graft tests
modified:README.rst+2 added-4 removed
30 unmodified lines
31 from flask import Flask3233 app = Flask(__name__)3435 @app.route('/')35 @app.route("/")36 def hello():37 return 'Hello, World!'37 return "Hello, World!"3839.. code-block:: text4041 $ FLASK_APP=hello.py flask run
16 unmodified lines
58-----5960* 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/t6rrQZH6768.. _WSGI: https://wsgi.readthedocs.io69.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/
2 unmodified lines
modified:setup.cfg+4 added-8 removed
1[aliases]2release = egg_info -Db ''1[metadata]2license_file = LICENSE.rst34[bdist_wheel]5universal = 15universal = true67[metadata]8license_file = LICENSE97[tool:pytest]11minversion = 3.08testpaths = tests910[coverage:run]11branch = True
4 unmodified lines
16[coverage:paths]17source =18 flask19 .tox/*/lib/python*/site-packages/flask24 .tox/pypy/site-packages/flask20 .tox/*/site-packages/flask
modified:setup.py+57 added-62 removed
1#!/usr/bin/env python2# -*- coding: utf-8 -*-1import io2import re5from collections import OrderedDict34from setuptools import find_packages5from setuptools import setup69with io.open('README.rst', 'rt', encoding='utf8') as f:7with io.open("README.rst", "rt", encoding="utf8") as f:8 readme = f.read()912with io.open('flask/__init__.py', 'rt', encoding='utf8') as f:13 version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)10with io.open("flask/__init__.py", "rt", encoding="utf8") as f:11 version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)1213setup(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)