Merge branch '1.0.x'

This commit is contained in:
David Lord 2019-06-23 16:56:42 -07:00
commit 1351d0a565
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
84 changed files with 1029 additions and 1439 deletions

12
AUTHORS
View File

@ -1,12 +0,0 @@
Flask is developed and maintained by the Pallets team and community
contributors. It was created by Armin Ronacher. The core maintainers
are:
- David Lord (davidism)
- Adrian Mönnich (ThiefMaster)
- Armin Ronacher (mitsuhiko)
- Marcus Unterwaditzer (untitaker)
A full list of contributors is available from git with::
git shortlog -sne

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Support questions
Please, don't use the issue tracker for this. Use one of the following
resources for questions about your own code:
* The ``#get-help`` channel on our Discord chat: https://discord.gg/t6rrQZH
* The ``#get-help`` channel on our Discord chat: https://discordapp.com/invite/t6rrQZH
* The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but
Discord is preferred.
@ -24,15 +24,15 @@ Reporting issues
----------------
- Describe what you expected to happen.
- If possible, include a `minimal, complete, and verifiable example`_ to help
us identify the issue. This also helps check that the issue is not with your
own code.
- If possible, include a `minimal reproducible example`_ to help us
identify the issue. This also helps check that the issue is not with
your own code.
- Describe what actually happened. Include the full traceback if there was an
exception.
- List your Python, Flask, and Werkzeug versions. If possible, check if this
issue is already fixed in the repository.
.. _minimal, complete, and verifiable example: https://stackoverflow.com/help/mcve
.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
Submitting patches
------------------
@ -85,10 +85,10 @@ First time setup
.. _GitHub account: https://github.com/join
.. _latest version of git: https://git-scm.com/downloads
.. _username: https://help.github.com/articles/setting-your-username-in-git/
.. _email: https://help.github.com/articles/setting-your-email-in-git/
.. _username: https://help.github.com/en/articles/setting-your-username-in-git
.. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git
.. _Fork: https://github.com/pallets/flask/fork
.. _Clone: https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork
.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork
Start coding
~~~~~~~~~~~~
@ -117,7 +117,7 @@ Start coding
.. _Black: https://black.readthedocs.io
.. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html
.. _pre-commit: https://pre-commit.com
.. _create a pull request: https://help.github.com/articles/creating-a-pull-request/
.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request
.. _contributing-testsuite:
@ -166,20 +166,9 @@ Build the docs in the ``docs`` directory using Sphinx::
Open ``_build/html/index.html`` in your browser to view the docs.
Read more about `Sphinx <https://www.sphinx-doc.org>`_.
Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.
make targets
~~~~~~~~~~~~
Flask provides a ``Makefile`` with various shortcuts. They will ensure that
all dependencies are installed.
- ``make test`` runs the basic test suite with ``pytest``
- ``make cov`` runs the basic test suite with ``coverage``
- ``make test-all`` runs the full test suite with ``tox``
- ``make docs`` builds the HTML documentation
Caution: zero-padded file modes
-------------------------------

31
LICENSE
View File

@ -1,31 +0,0 @@
Copyright © 2010 by the Pallets team.
Some rights reserved.
Redistribution and use in source and binary forms of the software as
well as documentation, with or without modification, are permitted
provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

28
LICENSE.rst Normal file
View File

@ -0,0 +1,28 @@
Copyright 2010 Pallets
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,11 +1,8 @@
include Makefile CHANGES.rst CONTRIBUTING.rst LICENSE AUTHORS tox.ini
include CHANGES.rst
include CONTRIBUTING.rst
include tox.ini
graft artwork
graft tests
graft examples
graft docs
global-exclude *.py[co]
prune docs/_build
prune docs/_themes
graft examples
graft tests

View File

@ -1,32 +0,0 @@
.PHONY: all install-dev test coverage cov test-all tox docs release clean-pyc upload-docs ebook
all: test
install-dev:
pip install -q -e .[dev]
test: clean-pyc install-dev
pytest
coverage: clean-pyc install-dev
coverage run -m pytest
coverage report
coverage html
cov: coverage
test-all: install-dev
tox
tox: test-all
docs: clean-pyc install-dev
$(MAKE) -C docs html
release:
python scripts/make-release.py
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

View File

@ -32,9 +32,9 @@ A Simple Example
app = Flask(__name__)
@app.route('/')
@app.route("/")
def hello():
return 'Hello, World!'
return "Hello, World!"
.. code-block:: text
@ -68,12 +68,10 @@ Links
* Website: https://www.palletsprojects.com/p/flask/
* Documentation: http://flask.pocoo.org/docs/
* License: `BSD <https://github.com/pallets/flask/blob/master/LICENSE>`_
* Releases: https://pypi.org/project/Flask/
* Code: https://github.com/pallets/flask
* Issue tracker: https://github.com/pallets/flask/issues
* Test status: https://dev.azure.com/pallets/pallets/_build?definitionId=2
* Test coverage: https://codecov.io/gh/pallets/flask
* Official chat: https://discord.gg/t6rrQZH
.. _WSGI: https://wsgi.readthedocs.io

View File

@ -1,20 +0,0 @@
Copyright (c) 2010 by Armin Ronacher.
Some rights reserved.
This logo or a modified version may be used by anyone to refer to the
Flask project, but does not indicate endorsement by the project.
Redistribution and use in source (the SVG file) and binary forms (rendered
PNG files etc.) of the image, with or without modification, are permitted
provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice and this list of conditions.
* The names of the contributors to the Flask software (see AUTHORS) may
not be used to endorse or promote products derived from this software
without specific prior written permission.
Note: we would appreciate that you make the image a link to
http://flask.pocoo.org/ if you use it on a web page.

19
artwork/LICENSE.rst Normal file
View File

@ -0,0 +1,19 @@
Copyright 2010 Pallets
This logo or a modified version may be used by anyone to refer to the
Flask project, but does not indicate endorsement by the project.
Redistribution and use in source (SVG) and binary (renders in PNG, etc.)
forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright
notice and this list of conditions.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
We would appreciate that you make the image a link to
https://palletsprojects.com/p/flask/ if you use it in a medium that
supports links.

View File

@ -4,7 +4,6 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = Flask
SOURCEDIR = .
BUILDDIR = _build

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -43,9 +43,9 @@ Incoming Request Data
.. attribute:: base_url
.. attribute:: url_root
Provides different ways to look at the current `IRI
<https://tools.ietf.org/html/rfc3987>`_. Imagine your application is
listening on the following application root::
Provides different ways to look at the current :rfc:`3987`.
Imagine your application is listening on the following application
root::
http://www.example.com/myapplication

View File

@ -45,7 +45,7 @@ The :ref:`app-dispatch` chapter shows in detail how to apply middleware. You
can introduce WSGI middleware to wrap your Flask instances and introduce fixes
and changes at the layer between your Flask application and your HTTP
server. Werkzeug includes several `middlewares
<http://werkzeug.pocoo.org/docs/middlewares/>`_.
<https://werkzeug.palletsprojects.com/middleware/>`_.
Fork.
-----

View File

@ -1 +1,4 @@
Changelog
=========
.. include:: ../CHANGES.rst

View File

@ -10,7 +10,7 @@ interface, in your virtualenv. Executed from the terminal, this script gives
access to built-in, extension, and application-defined commands. The ``--help``
option will give more information about any commands and options.
.. _Click: http://click.pocoo.org/
.. _Click: https://click.palletsprojects.com/
Application Discovery
@ -272,7 +272,7 @@ Custom Commands
The ``flask`` command is implemented using `Click`_. See that project's
documentation for full information about writing commands.
This example adds the command ``create_user`` that takes the argument
This example adds the command ``create-user`` that takes the argument
``name``. ::
import click
@ -280,14 +280,14 @@ This example adds the command ``create_user`` that takes the argument
app = Flask(__name__)
@app.cli.command()
@click.argument('name')
@app.cli.command("create-user")
@click.argument("name")
def create_user(name):
...
::
$ flask create_user admin
$ flask create-user admin
This example adds the same command, but as ``user create``, a command in a
group. This is useful if you want to organize multiple related commands. ::
@ -310,7 +310,6 @@ group. This is useful if you want to organize multiple related commands. ::
$ flask user create demo
See :ref:`testing-cli` for an overview of how to test your custom
commands.
@ -417,7 +416,7 @@ they are installed. Entry points are specified in :file:`setup.py` ::
)
.. _entry point: https://packaging.python.org/tutorials/distributing-packages/#entry-points
.. _entry point: https://packaging.python.org/tutorials/packaging-projects/#entry-points
Inside :file:`flask_my_extension/commands.py` you can then export a Click
object::
@ -486,7 +485,7 @@ script is available. Note that you don't need to set ``FLASK_APP``. ::
The ``flask`` command, being separate from your code, does not have
this issue and is recommended in most cases.
.. _console script: https://packaging.python.org/tutorials/distributing-packages/#console-scripts
.. _console script: https://packaging.python.org/tutorials/packaging-projects/#console-scripts
PyCharm Integration

View File

@ -1,13 +1,11 @@
from __future__ import print_function
from pallets_sphinx_themes import get_version
from pallets_sphinx_themes import ProjectLink
# Project --------------------------------------------------------------
project = "Flask"
copyright = "2010 Pallets Team"
author = "Pallets Team"
copyright = "2010 Pallets"
author = "Pallets"
release, version = get_version("Flask")
# General --------------------------------------------------------------
@ -22,7 +20,7 @@ extensions = [
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"werkzeug": ("http://werkzeug.pocoo.org/docs/", None),
"werkzeug": ("https://werkzeug.palletsprojects.com/", None),
"click": ("https://click.palletsprojects.com/", None),
"jinja": ("http://jinja.pocoo.org/docs/", None),
"itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),
@ -46,31 +44,21 @@ html_context = {
]
}
html_sidebars = {
"index": ["project.html", "localtoc.html", "versions.html", "searchbox.html"],
"**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],
"index": ["project.html", "localtoc.html", "searchbox.html"],
"**": ["localtoc.html", "relations.html", "searchbox.html"],
}
singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}
singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
html_static_path = ["_static"]
html_favicon = "_static/flask-icon.png"
html_logo = "_static/flask-logo-sidebar.png"
html_logo = "_static/flask-icon.png"
html_title = "Flask Documentation ({})".format(version)
html_show_sourcelink = False
html_domain_indices = False
# LaTeX ----------------------------------------------------------------
latex_documents = [
(master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")
]
latex_use_modindex = False
latex_elements = {
"papersize": "a4paper",
"pointsize": "12pt",
"fontpkg": r"\usepackage{mathpazo}",
"preamble": r"\usepackage{flaskstyle}",
}
latex_use_parts = True
latex_additional_files = ["flaskstyle.sty", "logo.pdf"]
# Local Extensions -----------------------------------------------------

View File

@ -1,62 +0,0 @@
User's Guide
------------
This part of the documentation, which is mostly prose, begins with some
background information about Flask, then focuses on step-by-step
instructions for web development with Flask.
.. toctree::
:maxdepth: 2
foreword
advanced_foreword
installation
quickstart
tutorial/index
templating
testing
errorhandling
logging
config
signals
views
appcontext
reqcontext
blueprints
extensions
cli
server
shell
patterns/index
deploying/index
becomingbig
API Reference
-------------
If you are looking for information on a specific function, class or
method, this part of the documentation is for you.
.. toctree::
:maxdepth: 2
api
Additional Notes
----------------
Design notes, legal information and changelog are here for the interested.
.. toctree::
:maxdepth: 2
design
htmlfaq
security
unicode
extensiondev
styleguide
upgrading
changelog
license
contributing

View File

@ -58,4 +58,4 @@ won't work in that case:
For more information consult the documentation of your webserver.
.. _App Engine: https://developers.google.com/appengine/
.. _App Engine: https://cloud.google.com/appengine/docs/

View File

@ -17,12 +17,9 @@ Hosted options
--------------
- `Deploying Flask on Heroku <https://devcenter.heroku.com/articles/getting-started-with-python>`_
- `Deploying Flask on OpenShift <https://developers.openshift.com/en/python-flask.html>`_
- `Deploying Flask on Webfaction <http://flask.pocoo.org/snippets/65/>`_
- `Deploying Flask on Google App Engine <https://cloud.google.com/appengine/docs/standard/python/getting-started/python-standard-env>`_
- `Deploying Flask on AWS Elastic Beanstalk <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html>`_
- `Sharing your Localhost Server with Localtunnel <http://flask.pocoo.org/snippets/89/>`_
- `Deploying on Azure (IIS) <https://azure.microsoft.com/documentation/articles/web-sites-python-configure/>`_
- `Deploying on Azure (IIS) <https://docs.microsoft.com/en-us/azure/app-service/containers/how-to-configure-python>`_
- `Deploying on PythonAnywhere <https://help.pythonanywhere.com/pages/Flask/>`_
Self-hosted options

View File

@ -70,4 +70,4 @@ to have it in the URL root its a bit simpler::
.. _nginx: https://nginx.org/
.. _lighttpd: https://www.lighttpd.net/
.. _cherokee: http://cherokee-project.com/
.. _uwsgi: https://uwsgi-docs.readthedocs.io/
.. _uwsgi: https://uwsgi-docs.readthedocs.io/en/latest/

View File

@ -85,7 +85,7 @@ application from ``myproject``::
$ twistd -n web --port tcp:8080 --wsgi myproject.app
.. _Twisted: https://twistedmatrix.com/
.. _Twisted: https://twistedmatrix.com/trac/
.. _Twisted Web: https://twistedmatrix.com/trac/wiki/TwistedWeb
.. _deploying-proxy-setups:

View File

@ -4,9 +4,8 @@ Flask Extension Development
===========================
Flask, being a microframework, often requires some repetitive steps to get
a third party library working. Because very often these steps could be
abstracted to support multiple projects the `Flask Extension Registry`_
was created.
a third party library working. Many such extensions are already available
on `PyPI <https://pypi.org/search/?c=Framework+%3A%3A+Flask>`_.
If you want to create your own Flask extension for something that does not
exist yet, this guide to extension development will help you get your
@ -328,8 +327,8 @@ extension to be approved you have to follow these guidelines:
6. Approved extensions must define all their dependencies in the
:file:`setup.py` file unless a dependency cannot be met because it is not
available on PyPI.
7. The documentation must use the ``flask`` theme from the `Official
Pallets Themes`_.
7. The documentation must use the ``flask`` theme from the
`Official Pallets Themes`_.
8. The setup.py description (and thus the PyPI description) has to
link to the documentation, website (if there is one) and there
must be a link to automatically install the development version
@ -342,4 +341,4 @@ extension to be approved you have to follow these guidelines:
.. _OAuth extension: https://pythonhosted.org/Flask-OAuth/
.. _mailinglist: http://flask.pocoo.org/mailinglist/
.. _IRC channel: http://flask.pocoo.org/community/irc/
.. _Official Pallets Themes: https://pypi.org/project/pallets-sphinx-themes/
.. _Official Pallets Themes: https://pypi.org/project/Pallets-Sphinx-Themes/

View File

@ -1,124 +0,0 @@
\definecolor{TitleColor}{rgb}{0,0,0}
\definecolor{InnerLinkColor}{rgb}{0,0,0}
% Replace Unicode character 'PARTY POPPER' (U+1F389) with a non-breaking space.
% pdfLaTeX doesn't support Unicode.
\DeclareUnicodeCharacter{1F389}{\nobreakspace}
\renewcommand{\maketitle}{%
\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
% Apply following fix only on PDF output, i.e. pdfoutput macro is not
% undefined
\ifx\pdfoutput\undefined\else
\begingroup
% This \def is required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
\def\\{, }
\pdfinfo{
/Author (\@author)
/Title (\@title)
}
\endgroup
\fi
\begin{flushright}%
%\sphinxlogo%
{\center
\vspace*{3cm}
\includegraphics{logo.pdf}
\vspace{3cm}
\par
{\rm\Huge \@title \par}%
{\em\LARGE \py@release\releaseinfo \par}
{\large
\@date \par
\py@authoraddress \par
}}%
\end{flushright}%\par
\@thanks
\end{titlepage}%
\cleardoublepage%
\setcounter{footnote}{0}%
\let\thanks\relax\let\maketitle\relax
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
}
\fancypagestyle{normal}{
\fancyhf{}
\fancyfoot[LE,RO]{{\thepage}}
\fancyfoot[LO]{{\nouppercase{\rightmark}}}
\fancyfoot[RE]{{\nouppercase{\leftmark}}}
\fancyhead[LE,RO]{{ \@title, \py@release}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE,RO]{{\thepage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
}
\titleformat{\section}{\Large}%
{\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor}
\titleformat{\subsection}{\large}%
{\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
\titleformat{\subsubsection}{}%
{\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
\titleformat{\paragraph}{\large}%
{\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor}
\ChNameVar{\raggedleft\normalsize}
\ChNumVar{\raggedleft \bfseries\Large}
\ChTitleVar{\raggedleft \rm\Huge}
\renewcommand\thepart{\@Roman\c@part}
\renewcommand\part{%
\pagestyle{plain}
\if@noskipsec \leavevmode \fi
\cleardoublepage
\vspace*{6cm}%
\@afterindentfalse
\secdef\@part\@spart}
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
{\parindent \z@ %\center
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >\m@ne
\rm\Large \partname~\thepart
\par\nobreak
\fi
\MakeUppercase{\rm\Huge #2}%
\markboth{}{}\par}%
\nobreak
\vskip 8ex
\@afterheading}
\def\@spart#1{%
{\parindent \z@ %\center
\interlinepenalty \@M
\normalfont
\huge \bfseries #1\par}%
\nobreak
\vskip 3ex
\@afterheading}
% use inconsolata font
\usepackage{inconsolata}
% fix single quotes, for inconsolata. (does not work)
%%\usepackage{textcomp}
%%\begingroup
%% \catcode`'=\active
%% \g@addto@macro\@noligs{\let'\textsinglequote}
%% \endgroup
%%\endinput

View File

@ -186,7 +186,7 @@ Many other features have been added, as well. A good guide to new features
in HTML5 is Mark Pilgrim's soon-to-be-published book, `Dive Into HTML5`_.
Not all of them are supported in browsers yet, however, so use caution.
.. _Dive Into HTML5: http://diveintohtml5.info/table-of-contents.html
.. _Dive Into HTML5: https://diveintohtml5.info/
What should be used?
--------------------

View File

@ -21,9 +21,73 @@ Flask depends on the `Jinja`_ template engine and the `Werkzeug`_ WSGI
toolkit. The documentation for these libraries can be found at:
- `Jinja documentation <http://jinja.pocoo.org/docs>`_
- `Werkzeug documentation <http://werkzeug.pocoo.org/docs>`_
- `Werkzeug documentation <https://werkzeug.palletsprojects.com/>`_
.. _Jinja: https://www.palletsprojects.com/p/jinja/
.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/
.. include:: contents.rst.inc
User's Guide
------------
This part of the documentation, which is mostly prose, begins with some
background information about Flask, then focuses on step-by-step
instructions for web development with Flask.
.. toctree::
:maxdepth: 2
foreword
advanced_foreword
installation
quickstart
tutorial/index
templating
testing
errorhandling
logging
config
signals
views
appcontext
reqcontext
blueprints
extensions
cli
server
shell
patterns/index
deploying/index
becomingbig
API Reference
-------------
If you are looking for information on a specific function, class or
method, this part of the documentation is for you.
.. toctree::
:maxdepth: 2
api
Additional Notes
----------------
Design notes, legal information and changelog are here for the interested.
.. toctree::
:maxdepth: 2
design
htmlfaq
security
unicode
extensiondev
styleguide
upgrading
changelog
license
contributing

View File

@ -25,11 +25,11 @@ These distributions will be installed automatically when installing Flask.
* `Click`_ is a framework for writing command line applications. It provides
the ``flask`` command and allows adding custom management commands.
.. _Werkzeug: http://werkzeug.pocoo.org/
.. _Jinja: http://jinja.pocoo.org/
.. _MarkupSafe: https://pypi.org/project/MarkupSafe/
.. _ItsDangerous: https://pythonhosted.org/itsdangerous/
.. _Click: http://click.pocoo.org/
.. _Werkzeug: https://palletsprojects.com/p/werkzeug/
.. _Jinja: https://palletsprojects.com/p/jinja/
.. _MarkupSafe: https://palletsprojects.com/p/markupsafe/
.. _ItsDangerous: https://palletsprojects.com/p/itsdangerous/
.. _Click: https://palletsprojects.com/p/click/
Optional dependencies
~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,6 +0,0 @@
:orphan:
Flask Documentation
===================
.. include:: contents.rst.inc

View File

@ -1,48 +1,19 @@
License
=======
Flask is licensed under a three clause BSD License. It basically means:
do whatever you want with it as long as the copyright in Flask sticks
around, the conditions are not modified and the disclaimer is present.
Furthermore you must not use the names of the authors to promote derivatives
of the software without written consent.
Source License
--------------
The full license text can be found below (:ref:`flask-license`). For the
documentation and artwork different licenses apply.
This license applies to all files in the Flask repository and source
distribution. This includes Flask's source code, the examples, and
tests, as well as the documentation.
.. _authors:
Authors
-------
.. include:: ../AUTHORS
General License Definitions
---------------------------
The following section contains the full license texts for Flask and the
documentation.
- "AUTHORS" hereby refers to all the authors listed in the
:ref:`authors` section.
- The ":ref:`flask-license`" applies to all the source code shipped as
part of Flask (Flask itself as well as the examples and the unittests)
as well as documentation.
- The ":ref:`artwork-license`" applies to the project's Horn-Logo.
.. _flask-license:
Flask License
-------------
.. include:: ../LICENSE
.. include:: ../LICENSE.rst
.. _artwork-license:
Artwork License
---------------
Flask Artwork License
---------------------
This license applies to Flask's logo.
.. include:: ../artwork/LICENSE
.. include:: ../artwork/LICENSE.rst

Binary file not shown.

View File

@ -9,7 +9,6 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=Flask
if "%1" == "" goto help
@ -22,7 +21,7 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
echo.http://sphinx-doc.org/
exit /b 1
)

View File

@ -60,7 +60,7 @@ Factories & Extensions
It's preferable to create your extensions and app factories so that the
extension object does not initially get bound to the application.
Using `Flask-SQLAlchemy <http://flask-sqlalchemy.pocoo.org/>`_,
Using `Flask-SQLAlchemy <https://flask-sqlalchemy.palletsprojects.com/>`_,
as an example, you should not do something along those lines::
def create_app(config_filename):

View File

@ -97,3 +97,29 @@ An example template might be this:
<p>What you were looking for is just not there.
<p><a href="{{ url_for('index') }}">go somewhere nice</a>
{% endblock %}
Returning API errors as JSON
----------------------------
When using Flask for web APIs, you can use the same techniques as above
to return JSON responses to API errors. :func:`~flask.abort` is called
with a ``description`` parameter. The :meth:`~flask.errorhandler` will
use that as the JSON error message, and set the status code to 404.
.. code-block:: python
from flask import abort, jsonify
@app.errorhandler(404)
def resource_not_found(e):
return jsonify(error=str(e)), 404
@app.route("/cheese")
def get_one_cheese():
resource = get_resource()
if resource is None:
abort(404, description="Resource not found")
return jsonify(resource)

View File

@ -27,7 +27,7 @@ to add a script statement to the bottom of your ``<body>`` to load jQuery:
url_for('static', filename='jquery.js') }}"></script>
Another method is using Google's `AJAX Libraries API
<https://developers.google.com/speed/libraries/devguide>`_ to load jQuery:
<https://developers.google.com/speed/libraries/>`_ to load jQuery:
.. sourcecode:: html

View File

@ -22,7 +22,7 @@ if you want to get started quickly.
You can download `Flask-SQLAlchemy`_ from `PyPI
<https://pypi.org/project/Flask-SQLAlchemy/>`_.
.. _Flask-SQLAlchemy: http://flask-sqlalchemy.pocoo.org/
.. _Flask-SQLAlchemy: https://flask-sqlalchemy.palletsprojects.com/
Declarative

View File

@ -69,8 +69,8 @@ This launches a very simple builtin server, which is good enough for testing
but probably not what you want to use in production. For deployment options see
:ref:`deployment`.
Now head over to `http://127.0.0.1:5000/ <http://127.0.0.1:5000/>`_, and you
should see your hello world greeting.
Now head over to http://127.0.0.1:5000/, and you should see your hello
world greeting.
.. _public-server:
@ -167,7 +167,7 @@ Screenshot of the debugger in action:
More information on using the debugger can be found in the `Werkzeug
documentation`_.
.. _Werkzeug documentation: http://werkzeug.pocoo.org/docs/debug/#using-the-debugger
.. _Werkzeug documentation: https://werkzeug.palletsprojects.com/debug/#using-the-debugger
Have another debugger in mind? See :ref:`working-with-debuggers`.
@ -389,7 +389,7 @@ package it's actually inside your package:
For templates you can use the full power of Jinja2 templates. Head over
to the official `Jinja2 Template Documentation
<http://jinja.pocoo.org/docs/templates>`_ for more information.
<http://jinja.pocoo.org/docs/templates/>`_ for more information.
Here is an example template:
@ -862,9 +862,8 @@ Here are some example log calls::
app.logger.error('An error occurred')
The attached :attr:`~flask.Flask.logger` is a standard logging
:class:`~logging.Logger`, so head over to the official `logging
documentation <https://docs.python.org/library/logging.html>`_ for more
information.
:class:`~logging.Logger`, so head over to the official :mod:`logging`
docs for more information.
Read more on :ref:`application-errors`.

View File

@ -1,4 +1,4 @@
Sphinx~=1.8.0
Pallets-Sphinx-Themes~=1.1.0
Sphinx~=2.1.2
Pallets-Sphinx-Themes~=1.1.4
sphinxcontrib-log-cabinet~=1.0.0
sphinx-issues~=1.2.0

View File

@ -11,7 +11,7 @@ An extension can depend on Jinja2 being present.
This section only gives a very quick introduction into how Jinja2
is integrated into Flask. If you want information on the template
engine's syntax itself, head over to the official `Jinja2 Template
Documentation <http://jinja.pocoo.org/docs/templates>`_ for
Documentation <http://jinja.pocoo.org/docs/templates/>`_ for
more information.
Jinja Setup

View File

@ -20,8 +20,7 @@ framework for our tests. You can install it with ``pip``, like so::
$ pip install pytest
.. _pytest:
https://pytest.org
.. _pytest: https://docs.pytest.org/
The Application
---------------
@ -455,5 +454,5 @@ This is useful for testing complex validation rules and custom types. ::
context = hello_command.make_context('hello', ['--name', 'flask'])
assert context.params['name'] == 'FLASK'
.. _click: http://click.pocoo.org/
.. _utilities for testing: http://click.pocoo.org/testing
.. _click: https://click.palletsprojects.com/
.. _utilities for testing: https://click.palletsprojects.com/testing/

View File

@ -116,6 +116,6 @@ your application. Waitress is just an example, chosen for the tutorial
because it supports both Windows and Linux. There are many more WSGI
servers and deployment options that you may choose for your project.
.. _Waitress: https://docs.pylonsproject.org/projects/waitress/
.. _Waitress: https://docs.pylonsproject.org/projects/waitress/en/stable/
Continue to :doc:`next`.

View File

@ -70,7 +70,7 @@ files.
See the `official packaging guide`_ for another explanation of the files
and options used.
.. _official packaging guide: https://packaging.python.org/tutorials/distributing-packages/
.. _official packaging guide: https://packaging.python.org/tutorials/packaging-projects/
Install the Project

View File

@ -6,9 +6,9 @@ text. Not only these libraries, also the majority of web related Python
libraries that deal with text. If you don't know Unicode so far, you
should probably read `The Absolute Minimum Every Software Developer
Absolutely, Positively Must Know About Unicode and Character Sets
<https://www.joelonsoftware.com/articles/Unicode.html>`_. This part of the
documentation just tries to cover the very basics so that you have a
pleasant experience with Unicode related things.
<https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/>`_.
This part of the documentation just tries to cover the very basics so
that you have a pleasant experience with Unicode related things.
Automatic Conversion
--------------------

View File

@ -1,164 +0,0 @@
#!/usr/bin/env python
from __future__ import print_function
import os
import re
import sys
from datetime import date
from datetime import datetime
from subprocess import PIPE
from subprocess import Popen
_date_strip_re = re.compile(r"(?<=\d)(st|nd|rd|th)")
def parse_changelog():
with open("CHANGES.rst") as f:
lineiter = iter(f)
for line in lineiter:
match = re.search(r"^Version\s+(.*)", line.strip())
if match is None:
continue
version = match.group(1).strip()
if next(lineiter).count("-") != len(match.group(0)):
continue
while 1:
change_info = next(lineiter).strip()
if change_info:
break
match = re.search(
r"released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?",
change_info,
flags=re.IGNORECASE,
)
if match is None:
continue
datestr, codename = match.groups()
return version, parse_date(datestr), codename
def bump_version(version):
try:
parts = [int(i) for i in version.split(".")]
except ValueError:
fail("Current version is not numeric")
parts[-1] += 1
return ".".join(map(str, parts))
def parse_date(string):
string = _date_strip_re.sub("", string)
return datetime.strptime(string, "%B %d %Y")
def set_filename_version(filename, version_number, pattern):
changed = []
def inject_version(match):
before, old, after = match.groups()
changed.append(True)
return before + version_number + after
with open(filename) as f:
contents = re.sub(
r"^(\s*%s\s*=\s*')(.+?)(')" % pattern,
inject_version,
f.read(),
flags=re.DOTALL | re.MULTILINE,
)
if not changed:
fail("Could not find %s in %s", pattern, filename)
with open(filename, "w") as f:
f.write(contents)
def set_init_version(version):
info("Setting __init__.py version to %s", version)
set_filename_version("flask/__init__.py", version, "__version__")
def build():
cmd = [sys.executable, "setup.py", "sdist", "bdist_wheel"]
Popen(cmd).wait()
def fail(message, *args):
print("Error:", message % args, file=sys.stderr)
sys.exit(1)
def info(message, *args):
print(message % args, file=sys.stderr)
def get_git_tags():
return set(Popen(["git", "tag"], stdout=PIPE).communicate()[0].splitlines())
def git_is_clean():
return Popen(["git", "diff", "--quiet"]).wait() == 0
def make_git_commit(message, *args):
message = message % args
Popen(["git", "commit", "-am", message]).wait()
def make_git_tag(tag):
info('Tagging "%s"', tag)
Popen(["git", "tag", tag]).wait()
def main():
os.chdir(os.path.join(os.path.dirname(__file__), ".."))
rv = parse_changelog()
if rv is None:
fail("Could not parse changelog")
version, release_date, codename = rv
dev_version = bump_version(version) + ".dev"
info(
"Releasing %s (codename %s, release date %s)",
version,
codename,
release_date.strftime("%d/%m/%Y"),
)
tags = get_git_tags()
if version in tags:
fail('Version "%s" is already tagged', version)
if release_date.date() != date.today():
fail("Release date is not today (%s != %s)", release_date.date(), date.today())
if not git_is_clean():
fail("You have uncommitted changes in git")
try:
import wheel # noqa: F401
except ImportError:
fail("You need to install the wheel package.")
set_init_version(version)
make_git_commit("Bump version number to %s", version)
make_git_tag(version)
build()
set_init_version(dev_version)
if __name__ == "__main__":
main()

View File

@ -1,14 +1,10 @@
[aliases]
release = egg_info -Db ''
[metadata]
license_file = LICENSE.rst
[bdist_wheel]
universal = 1
[metadata]
license_file = LICENSE
universal = true
[tool:pytest]
minversion = 3.0
testpaths = tests
[coverage:run]
@ -21,7 +17,7 @@ source =
source =
src/flask
.tox/*/lib/python*/site-packages/flask
.tox/pypy/site-packages/flask
.tox/*/site-packages/flask
[flake8]
# B = bugbear

77
setup.py Executable file → Normal file
View File

@ -1,8 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import re
from collections import OrderedDict
from setuptools import find_packages
from setuptools import setup
@ -11,51 +8,24 @@ with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
with io.open("src/flask/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1)
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
setup(
name="Flask",
version=version,
url="https://www.palletsprojects.com/p/flask/",
project_urls=OrderedDict(
(
("Documentation", "http://flask.pocoo.org/docs/"),
("Code", "https://github.com/pallets/flask"),
("Issue tracker", "https://github.com/pallets/flask/issues"),
)
),
license="BSD",
url="https://palletsprojects.com/p/flask/",
project_urls={
"Documentation": "http://flask.palletsprojects.com/",
"Code": "https://github.com/pallets/flask",
"Issue tracker": "https://github.com/pallets/flask/issues",
},
license="BSD-3-Clause",
author="Armin Ronacher",
author_email="armin.ronacher@active-4.com",
maintainer="Pallets team",
maintainer="Pallets",
maintainer_email="contact@palletsprojects.com",
description="A simple framework for building complex web applications.",
long_description=readme,
packages=find_packages("src"),
package_dir={"": "src"},
include_package_data=True,
zip_safe=False,
platforms="any",
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
install_requires=[
"Werkzeug>=0.15",
"Jinja2>=2.10.1",
"itsdangerous>=0.24",
"click>=5.1",
],
extras_require={
"dotenv": ["python-dotenv"],
"dev": [
"pytest>=3",
"coverage",
"tox",
"sphinx",
"pallets-sphinx-themes",
"sphinxcontrib-log-cabinet",
"pre-commit",
],
"docs": ["sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
@ -67,7 +37,6 @@ setup(
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
@ -76,5 +45,33 @@ setup(
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
],
packages=find_packages("src"),
package_dir={"": "src"},
include_package_data=True,
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
install_requires=[
"Werkzeug>=0.15",
"Jinja2>=2.10.1",
"itsdangerous>=0.24",
"click>=5.1",
],
extras_require={
"dotenv": ["python-dotenv"],
"dev": [
"pytest",
"coverage",
"tox",
"sphinx",
"pallets-sphinx-themes",
"sphinxcontrib-log-cabinet",
"sphinx-issues",
],
"docs": [
"sphinx",
"pallets-sphinx-themes",
"sphinxcontrib-log-cabinet",
"sphinx-issues",
],
},
entry_points={"console_scripts": ["flask = flask.cli:main"]},
)

View File

@ -6,8 +6,8 @@
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
# utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface.
@ -56,4 +56,4 @@ from .signals import template_rendered
from .templating import render_template
from .templating import render_template_string
__version__ = "1.1.dev"
__version__ = "1.1.0.dev"

View File

@ -5,8 +5,8 @@
Alias for flask.run for the command line.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
if __name__ == "__main__":

View File

@ -7,8 +7,8 @@
version of six so we don't have to depend on a specific version
of it.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import sys

View File

@ -5,8 +5,8 @@
This module implements the central WSGI application object.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import os
import sys
@ -1332,7 +1332,13 @@ class Flask(_PackageBoundObject):
@staticmethod
def _get_exc_class_and_code(exc_class_or_code):
"""Ensure that we register only exceptions as handler keys"""
"""Get the exception class being handled. For HTTP status codes
or ``HTTPException`` subclasses, return both the exception and
status code.
:param exc_class_or_code: Any exception class, or an HTTP status
code as an integer.
"""
if isinstance(exc_class_or_code, integer_types):
exc_class = default_exceptions[exc_class_or_code]
else:

View File

@ -6,8 +6,8 @@
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from functools import update_wrapper
@ -88,11 +88,20 @@ class BlueprintSetupState(object):
class Blueprint(_PackageBoundObject):
"""Represents a blueprint. A blueprint is an object that records
functions that will be called with the
:class:`~flask.blueprints.BlueprintSetupState` later to register functions
or other things on the main application. See :ref:`blueprints` for more
information.
"""Represents a blueprint, a collection of routes and other
app-related functions that can be registered on a real application
later.
A blueprint is an object that allows defining application functions
without requiring an application object ahead of time. It uses the
same decorators as :class:`~flask.Flask`, but defers the need for an
application by recording them for later registration.
Decorating a function with a blueprint creates a deferred function
that is called with :class:`~flask.blueprints.BlueprintSetupState`
when the blueprint is registered on an application.
See :ref:`blueprints` for more information.
.. versionchanged:: 1.1.0
Blueprints have a ``cli`` group to register nested CLI commands.
@ -100,6 +109,35 @@ class Blueprint(_PackageBoundObject):
the ``flask`` command.
.. versionadded:: 0.7
:param name: The name of the blueprint. Will be prepended to each
endpoint name.
:param import_name: The name of the blueprint package, usually
``__name__``. This helps locate the ``root_path`` for the
blueprint.
:param static_folder: A folder with static files that should be
served by the blueprint's static route. The path is relative to
the blueprint's root path. Blueprint static files are disabled
by default.
:param static_url_path: The url to serve static files from.
Defaults to ``static_folder``. If the blueprint does not have
a ``url_prefix``, the app's static route will take precedence,
and the blueprint's static files won't be accessible.
:param template_folder: A folder with templates that should be added
to the app's template search path. The path is relative to the
blueprint's root path. Blueprint templates are disabled by
default. Blueprint templates have a lower precedence than those
in the app's templates folder.
:param url_prefix: A path to prepend to all of the blueprint's URLs,
to make them distinct from the rest of the app's routes.
:param subdomain: A subdomain that blueprint routes will match on by
default.
:param url_defaults: A dict of default values that blueprint routes
will receive by default.
:param root_path: By default, the blueprint will automatically this
based on ``import_name``. In certain situations this automatic
detection can fail, so the path can be specified manually
instead.
"""
warn_on_modifications = False

View File

@ -5,8 +5,8 @@
A simple command line application to run flask apps.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from __future__ import print_function

View File

@ -5,8 +5,8 @@
Implements the configuration related objects.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import errno
import os

View File

@ -5,8 +5,8 @@
Implements the objects required to keep the context.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import sys
from functools import update_wrapper

View File

@ -5,8 +5,8 @@
Various helpers to make the development experience better.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import os
from warnings import warn

View File

@ -6,8 +6,8 @@
Defines all the global objects that are proxies to the current
active context.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from functools import partial

View File

@ -5,8 +5,8 @@
Implements various helpers.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import io
import mimetypes

View File

@ -3,8 +3,8 @@
flask.json
~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import codecs
import io

View File

@ -38,8 +38,8 @@ processes dicts first, so insert the new tag at the front of the order since
app.session_interface.serializer.register(TagOrderedDict, index=0)
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from base64 import b64decode
from base64 import b64encode

View File

@ -3,8 +3,8 @@
flask.logging
~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from __future__ import absolute_import

View File

@ -5,8 +5,8 @@
Implements cookie based sessions based on itsdangerous.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import hashlib
import warnings

View File

@ -6,8 +6,8 @@
Implements signals based on blinker if available, otherwise
falls silently back to a noop.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
try:
from blinker import Namespace

View File

@ -5,8 +5,8 @@
Implements the bridge to Jinja2.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from jinja2 import BaseLoader
from jinja2 import Environment as BaseEnvironment

View File

@ -6,8 +6,8 @@
Implements test support helpers. This module is lazily imported
and usually not used in production environments.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import warnings
from contextlib import contextmanager

View File

@ -5,8 +5,8 @@
This module provides class-based views inspired by the ones in Django.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from ._compat import with_metaclass
from .globals import request

View File

@ -5,8 +5,8 @@
Implements the WSGI wrappers (request and response).
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from werkzeug.exceptions import BadRequest
from werkzeug.wrappers import Request as RequestBase

View File

@ -3,8 +3,8 @@
tests.conftest
~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import os
import pkgutil

View File

@ -5,8 +5,8 @@
Tests the application context.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import pytest

View File

@ -5,8 +5,8 @@
The basic functionality.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import re
import sys

View File

@ -5,8 +5,8 @@
Blueprints (and currently modules)
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import functools

View File

@ -3,8 +3,8 @@
tests.test_cli
~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
# This file was part of Flask-CLI and was modified under the terms of
# its Revised BSD License. Copyright © 2015 CERN.

View File

@ -3,8 +3,8 @@
tests.test_config
~~~~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import os
import textwrap

View File

@ -5,8 +5,8 @@
Various helpers.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import datetime
import io

View File

@ -3,8 +3,8 @@
tests.test_instance
~~~~~~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import os
import sys

View File

@ -3,8 +3,8 @@
tests.test_json_tag
~~~~~~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from datetime import datetime
from uuid import uuid4

View File

@ -3,8 +3,8 @@
tests.test_logging
~~~~~~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import logging
import sys

View File

@ -5,8 +5,8 @@
Tests regressions.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import gc
import sys

View File

@ -5,8 +5,8 @@
Tests the request context.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import pytest

View File

@ -5,8 +5,8 @@
Signalling.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import pytest

View File

@ -6,8 +6,8 @@
Test that certain behavior of flask can be customized by
subclasses.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import flask
from flask._compat import StringIO

View File

@ -5,8 +5,8 @@
Template functionality
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import logging

View File

@ -5,8 +5,8 @@
Test client and more.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import click
import pytest

View File

@ -3,8 +3,8 @@
tests.test_user_error_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import pytest
from werkzeug.exceptions import Forbidden

View File

@ -5,8 +5,8 @@
Pluggable views.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import pytest
from werkzeug.http import parse_set_header