Files
proxmox/venv/lib/python3.12/site-packages/flask/__pycache__/app.cpython-312.pyc

817 lines
61 KiB
Plaintext
Raw Normal View History

<EFBFBD>
<0E>Hi0<69><00><01><><00>ddlmZddlmZddlZddlZddlZddl Z ddl
m Z ddl m Z ddlmZddlmZddlmZddlZddlmZdd lmZdd
lmZdd lmZdd lmZdd lmZddlmZddlm Z ddlm!Z!ddlm"Z"ddl#m$Z$ddl%m&Z'ddl(m)Z)ddl*m+Z+ddl*mZ,ddl-m.Z.ddl-m/Z/ddl0m1Z1ddl0m2Z2ddl0m3Z3ddl0m4Z4ddl0m5Z5ddl0m6Z6dd l0m7Z7dd!l8m9Z9dd"l8m:Z:dd#l8m;Z;dd$l8m<Z<dd%l=m>Z>dd&l?m@Z@dd'lAmBZBdd(lAmCZCdd)lDmEZEdd*lDmFZFdd+lDmGZGdd,lDmHZHdd-lDmIZIdd.lJmKZKdd/lLmMZMddlLm&Z&ej<>rdd0lOmPZPdd1lOmQZQdd2lRmSZSdd3lRmTZTdd4lmUZUej<>d5e,j<><00>6<EFBFBD>ZXej<>d7e,j<><00>6<EFBFBD>ZZej<>d8e,j<><00>6<EFBFBD>Z\ej<>d9e,j<><00>6<EFBFBD>Z^ej<>d:e,j<><00>6<EFBFBD>Z`d>d;<3B>ZaGd<<3C>d=e><3E>Zby)?<3F>)<01> annotationsN)<01> timedelta)<01>iscoroutinefunction)<01>chain)<01> TracebackType)<01>quote)<01>Headers)<01> ImmutableDict)<01>BadRequestKeyError)<01> HTTPException)<01>InternalServerError)<01>
BuildError)<01>
MapAdapter)<01>RequestRedirect)<01>RoutingException)<01>Rule)<01>is_running_from_reloader)<01>Response)<01>get_host<73>)<01>cli)<01>typing<6E><01>
AppContext<EFBFBD><01>RequestContext)<01>_cv_app)<01> _cv_request)<01> current_app)<01>g)<01>request)<01> request_ctx)<01>session)<01>get_debug_flag)<01>get_flashed_messages)<01>get_load_dotenv)<01>send_from_directory)<01>App)<01> _sentinel)<01>SecureCookieSessionInterface)<01>SessionInterface)<01>appcontext_tearing_down)<01>got_request_exception)<01>request_finished)<01>request_started)<01>request_tearing_down)<01> Environment)<01>Request)<01> StartResponse)<01>WSGIEnvironment<6E><01> FlaskClient<6E><01>FlaskCliRunner)<01> HeadersValue<75>T_shell_context_processor)<01>bound<6E>
T_teardown<EFBFBD>T_template_filter<65>T_template_global<61>T_template_testc<01>B<00>|<00>t|t<00>r|St|<00><01>S)N)<01>seconds)<02>
isinstancer)<01>values <20>K/home/intlc/projects/proxmox/venv/lib/python3.12/site-packages/flask/app.py<70>_make_timedeltarEJs <00><00> <0C>}<7D>
<EFBFBD>5<EFBFBD>)<29>4<><14> <0C> <14>U<EFBFBD> #<23>#<23>c<01><00><00>eZdZUdZeidd<03>dd<05>dd<03>dd<03>dd<03>d ed
<EFBFBD> <0B><00>d d<05>d d<03>dd<03>dd<10>dd<12>dd<03>dd<03>dd<16>dd<05>dd<05>dd<03>ddddddddddddd<1E> <0C><01>ZeZde d <e
Z d!e d"<e <0C>Z d#e d$< dH dI<64>fd%<25> ZdJd&<26>ZdKd'<27>Z dL dMd(<28>Z dN dMd)<29>ZdOd*<2A>ZdPd+<2B>ZdQd,<2C>ZdRd-<2D>ZdSd.<2E>Z dT dUd/<2F>ZdVdWd0<64>ZdXd1<64>Z dYd2<64>Z dZd3<64>Zd[d4<64>Z d\d5<64>Zd]d6<64>Zd^d7<64>Z d_ d`d8<64>Z!d^d9<64>Z"dad:<3A>Z# dbd;<3B>Z$ddddd<<3C> dcd=<3D>Z%ddd><3E>Z&ded?<3F>Z'dfd@<40>Z(e)f dgdA<64>Z*e)f dgdB<64>Z+dhdC<64>Z,didD<64>Z-djdE<64>Z. dkdF<64>Z/ dkdG<64>Z0<5A>xZ1S)l<>Flaska<6B>The flask object implements a WSGI application and acts as the central
object. It is passed the name of the module or package of the
application. Once it is created it will act as a central registry for
the view functions, the URL rules, template configuration and much more.
The name of the package is used to resolve resources from inside the
package or the folder the module is contained in depending on if the
package parameter resolves to an actual python package (a folder with
an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).
For more information about resource loading, see :func:`open_resource`.
Usually you create a :class:`Flask` instance in your main module or
in the :file:`__init__.py` file of your package like this::
from flask import Flask
app = Flask(__name__)
.. admonition:: About the First Parameter
The idea of the first parameter is to give Flask an idea of what
belongs to your application. This name is used to find resources
on the filesystem, can be used by extensions to improve debugging
information and a lot more.
So it's important what you provide there. If you are using a single
module, `__name__` is always the correct value. If you however are
using a package, it's usually recommended to hardcode the name of
your package there.
For example if your application is defined in :file:`yourapplication/app.py`
you should create it with one of the two versions below::
app = Flask('yourapplication')
app = Flask(__name__.split('.')[0])
Why is that? The application will work even with `__name__`, thanks
to how resources are looked up. However it will make debugging more
painful. Certain extensions can make assumptions based on the
import name of your application. For example the Flask-SQLAlchemy
extension will look for the code in your application that triggered
an SQL query in debug mode. If the import name is not properly set
up, that debugging information is lost. (For example it would only
pick up SQL queries in `yourapplication.app` and not
`yourapplication.views.frontend`)
.. versionadded:: 0.7
The `static_url_path`, `static_folder`, and `template_folder`
parameters were added.
.. versionadded:: 0.8
The `instance_path` and `instance_relative_config` parameters were
added.
.. versionadded:: 0.11
The `root_path` parameter was added.
.. versionadded:: 1.0
The ``host_matching`` and ``static_host`` parameters were added.
.. versionadded:: 1.0
The ``subdomain_matching`` parameter was added. Subdomain
matching needs to be enabled manually now. Setting
:data:`SERVER_NAME` does not implicitly enable it.
:param import_name: the name of the application package
:param static_url_path: can be used to specify a different path for the
static files on the web. Defaults to the name
of the `static_folder` folder.
:param static_folder: The folder with static files that is served at
``static_url_path``. Relative to the application ``root_path``
or an absolute path. Defaults to ``'static'``.
:param static_host: the host to use when adding the static route.
Defaults to None. Required when using ``host_matching=True``
with a ``static_folder`` configured.
:param host_matching: set ``url_map.host_matching`` attribute.
Defaults to False.
:param subdomain_matching: consider the subdomain relative to
:data:`SERVER_NAME` when matching routes. Defaults to False.
:param template_folder: the folder that contains the templates that should
be used by the application. Defaults to
``'templates'`` folder in the root path of the
application.
:param instance_path: An alternative instance path for the application.
By default the folder ``'instance'`` next to the
package or module is assumed to be the instance
path.
:param instance_relative_config: if set to ``True`` relative filenames
for loading the config are assumed to
be relative to the instance path instead
of the application root.
:param root_path: The path to the root of the application files.
This should only be set manually when it can't be detected
automatically, such as for namespace packages.
<20>DEBUGN<47>TESTINGF<47>PROPAGATE_EXCEPTIONS<4E>
SECRET_KEY<EFBFBD>SECRET_KEY_FALLBACKS<4B>PERMANENT_SESSION_LIFETIME<4D>)<01>days<79>USE_X_SENDFILE<4C> TRUSTED_HOSTS<54> SERVER_NAME<4D>APPLICATION_ROOT<4F>/<2F>SESSION_COOKIE_NAMEr#<00>SESSION_COOKIE_DOMAIN<49>SESSION_COOKIE_PATH<54>SESSION_COOKIE_HTTPONLYT<59>SESSION_COOKIE_SECURE<52>SESSION_COOKIE_PARTITIONED<45>SESSION_COOKIE_SAMESITEi <20>i<><00>httpi<70>) <0C>SESSION_REFRESH_EACH_REQUEST<53>MAX_CONTENT_LENGTH<54>MAX_FORM_MEMORY_SIZE<5A>MAX_FORM_PARTS<54>SEND_FILE_MAX_AGE_DEFAULT<4C>TRAP_BAD_REQUEST_ERRORS<52>TRAP_HTTP_EXCEPTIONS<4E>EXPLAIN_TEMPLATE_LOADING<4E>PREFERRED_URL_SCHEME<4D>TEMPLATES_AUTO_RELOAD<41>MAX_COOKIE_SIZE<5A>PROVIDE_AUTOMATIC_OPTIONSz type[Request]<5D> request_classztype[Response]<5D>response_classr+<00>session_interfacec <01>Z<00><01> <0B>t<00> |<00>||||||||| |
<EFBFBD><01>
tj<00>|_|j|j_|j
rPt |<04>|k(sJd<02><00>tj|<00><00> |j|j<00>d<03>d|<04> fd<05><08><06>yy)N)
<EFBFBD> import_name<6D>static_url_path<74> static_folder<65> static_host<73> host_matching<6E>subdomain_matching<6E>template_folder<65> instance_path<74>instance_relative_config<69> root_pathz-Invalid static_host/host_matching combinationz/<path:filename><3E>staticc<01>2<00><01><00><01>jdi|<00><01>S)N<>)<01>send_static_file)<02>kw<6B>self_refs <20>rD<00><lambda>z Flask.__init__.<locals>.<lambda>s<00><><00>'B<>x<EFBFBD>z<EFBFBD>'B<>'B<>'H<>R<EFBFBD>'H<>rF)<03>endpoint<6E>host<73> view_func) <0B>super<65>__init__r<00>AppGroup<75>name<6D>has_static_folder<65>bool<6F>weakref<65>ref<65> add_url_rulero) <0A>selfrnrorprqrrrsrtrurvrwr}<00> __class__s @<40>rDr<>zFlask.__init__<5F>s<><00><><00> <0E><07><18>#<23>+<2B>'<27>#<23>'<27>1<>+<2B>'<27>%=<3D><1F> <19>
<EFBFBD>"<17><<3C><<3C>><3E><04><08><1D> <09> <09><04><08><08> <0A> <10> !<21> !<21><17> <0B>$<24> <0A>5<> <0E>?<3F> <0E>5<>
<1F>{<7B>{<7B>4<EFBFBD>(<28>H<EFBFBD> <10> <1D> <1D><17>'<27>'<27>(<28>(8<>9<>!<21> <20>H<> <1E> <0E> "rFc<01><><00>tjd}|<02>yt|t<00>rt |j <00><00>S|S)anUsed by :func:`send_file` to determine the ``max_age`` cache
value for a given file path if it wasn't passed.
By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from
the configuration of :data:`~flask.current_app`. This defaults
to ``None``, which tells the browser to use conditional requests
instead of a timed cache, which is usually preferable.
Note this is a duplicate of the same method in the Flask
class.
.. versionchanged:: 2.0
The default configuration is ``None`` instead of 12 hours.
.. versionadded:: 0.9
rbN)r<00>configrBr<00>int<6E> total_seconds)r<><00>filenamerCs rD<00>get_send_file_max_agezFlask.get_send_file_max_ages@<00><00>"<1C>"<22>"<22>#><3E>?<3F><05> <10>=<3D><17> <15>e<EFBFBD>Y<EFBFBD> '<27><16>u<EFBFBD>*<2A>*<2A>,<2C>-<2D> -<2D><14> rFc<01><><00>|js td<01><00>|j|<01>}tt j
t |j<00>||<02><02>S)aAThe view function used to serve files from
:attr:`static_folder`. A route is automatically registered for
this view at :attr:`static_url_path` if :attr:`static_folder` is
set.
Note this is a duplicate of the same method in the Flask
class.
.. versionadded:: 0.5
z2'static_folder' must be set to serve static_files.)<01>max_age)r<><00> RuntimeErrorr<72>r'<00>t<>cast<73>strrp)r<>r<>r<>s rDr{zFlask.send_static_file4sP<00><00><14>%<25>%<25><1E>S<>T<> T<><17>,<2C>,<2C>X<EFBFBD>6<><07>"<22> <0A>F<EFBFBD>F<EFBFBD>3<EFBFBD><04>*<2A>*<2A> +<2B>X<EFBFBD>w<EFBFBD>
<EFBFBD>
rFc<01><><00>|dvr td<02><00>tjj|j|<01>}|dk(r t ||<02>St |||<03><04>S)a Open a resource file relative to :attr:`root_path` for reading.
For example, if the file ``schema.sql`` is next to the file
``app.py`` where the ``Flask`` app is defined, it can be opened
with:
.. code-block:: python
with app.open_resource("schema.sql") as f:
conn.executescript(f.read())
:param resource: Path to the resource relative to :attr:`root_path`.
:param mode: Open the file in this mode. Only reading is supported,
valid values are ``"r"`` (or ``"rt"``) and ``"rb"``.
:param encoding: Open the file with this encoding when opening in text
mode. This is ignored when opening in binary mode.
.. versionchanged:: 3.1
Added the ``encoding`` parameter.
><00>r<>rb<72>rtz)Resources can only be opened for reading.r<><00><01>encoding)<06>
ValueError<EFBFBD>os<6F>path<74>joinrw<00>open<65>r<><00>resource<63>moder<65>r<>s rD<00> open_resourcezFlask.open_resourceJsT<00><00>. <10>(<28> (<28><1C>H<>I<> I<><11>w<EFBFBD>w<EFBFBD>|<7C>|<7C>D<EFBFBD>N<EFBFBD>N<EFBFBD>H<EFBFBD>5<><04> <0F>4<EFBFBD><<3C><17><04>d<EFBFBD>#<23> #<23><13>D<EFBFBD>$<24><18>2<>2rFc<01><><00>tjj|j|<01>}d|vr t ||<02>St |||<03><02>S)a(Open a resource file relative to the application's instance folder
:attr:`instance_path`. Unlike :meth:`open_resource`, files in the
instance folder can be opened for writing.
:param resource: Path to the resource relative to :attr:`instance_path`.
:param mode: Open the file in this mode.
:param encoding: Open the file with this encoding when opening in text
mode. This is ignored when opening in binary mode.
.. versionchanged:: 3.1
Added the ``encoding`` parameter.
<20>br<62>)r<>r<>r<>rur<>r<>s rD<00>open_instance_resourcezFlask.open_instance_resourceksA<00><00><12>w<EFBFBD>w<EFBFBD>|<7C>|<7C>D<EFBFBD>.<2E>.<2E><08>9<><04> <0E>$<24>;<3B><17><04>d<EFBFBD>#<23> #<23><13>D<EFBFBD>$<24><18>2<>2rFc<01><><00>t|j<00>}d|vr|j|d<d|vr"|jd}|<02> |j}||d<|j
|fi|<01><01>}|j j|jt|jttt<00><04>|jj|jd<|S)a<>Create the Jinja environment based on :attr:`jinja_options`
and the various Jinja-related methods of the app. Changing
:attr:`jinja_options` after this will have no effect. Also adds
Flask-related globals and filters to the environment.
.. versionchanged:: 0.11
``Environment.auto_reload`` set in accordance with
``TEMPLATES_AUTO_RELOAD`` configuration option.
.. versionadded:: 0.5
<20>
autoescape<EFBFBD> auto_reloadrg)<06>url_forr%r<>r!r#r zjson.dumps_function)<10>dict<63> jinja_options<6E>select_jinja_autoescaper<65><00>debug<75>jinja_environment<6E>globals<6C>updater<65>r%r!r#r <00>json<6F>dumps<70>policies)r<><00>optionsr<73><00>rvs rD<00>create_jinja_environmentzFlask.create_jinja_environment<6E>s<><00><00><17>t<EFBFBD>)<29>)<29>*<2A><07> <17>w<EFBFBD> &<26>$(<28>$@<40>$@<40>G<EFBFBD>L<EFBFBD> !<21> <18><07> '<27><1E>+<2B>+<2B>&=<3D>><3E>K<EFBFBD><1A>"<22>"<22>j<EFBFBD>j<EFBFBD> <0B>%0<>G<EFBFBD>M<EFBFBD> "<22> #<23>T<EFBFBD> #<23> #<23>D<EFBFBD> 4<>G<EFBFBD> 4<><02>
<EFBFBD>
<EFBFBD>
<EFBFBD><19><19><18>L<EFBFBD>L<EFBFBD>!5<><17>;<3B>;<3B><1C><1B><0F> <1A>
<EFBFBD>.2<EFBFBD>Y<EFBFBD>Y<EFBFBD>_<EFBFBD>_<EFBFBD><02> <0B> <0B>)<29>*<2A><11> rFc<01><00>|<01><>|jdx}<02>||_t|j|j<00>|_d}|jd}|j
j rd}n&|js|j
jxsd}|j
j|j||<03><05>S|jd<00>E|j
j|jd|jd|jd<00><08>Sy) a<>Creates a URL adapter for the given request. The URL adapter
is created at a point where the request context is not yet set
up so the request is passed explicitly.
.. versionchanged:: 3.1
If :data:`SERVER_NAME` is set, it does not restrict requests to
only that domain, for both ``subdomain_matching`` and
``host_matching``.
.. versionchanged:: 1.0
:data:`SERVER_NAME` no longer implicitly enables subdomain
matching. Use :attr:`subdomain_matching` instead.
.. versionchanged:: 0.9
This can be called outside a request when the URL adapter is created
for an application context.
.. versionadded:: 0.6
NrRrS<00>)<02> server_name<6D> subdomainrTrf)<02> script_name<6D>
url_scheme) r<><00> trusted_hostsr<00>environr<6E><00>url_maprrrs<00>default_subdomain<69>bind_to_environ<6F>bind)r<>r!r<>r<>r<>s rD<00>create_url_adapterzFlask.create_url_adapter<65>s<00><00>( <13> <1E>!%<25><1B><1B>_<EFBFBD>!=<3D>=<3D> <0A>J<>(5<><07>%<25>$<24>G<EFBFBD>O<EFBFBD>O<EFBFBD>W<EFBFBD>5J<35>5J<35>K<>G<EFBFBD>L<EFBFBD><1C>I<EFBFBD><1E>+<2B>+<2B>m<EFBFBD>4<>K<EFBFBD><13>|<7C>|<7C>)<29>)<29>#<23> <0B><19>,<2C>,<2C>!<21>L<EFBFBD>L<EFBFBD>:<3A>:<3A>@<40>b<EFBFBD> <09><17><<3C><<3C>/<2F>/<2F><17><0F><0F>[<5B>I<EFBFBD>0<><0E> <0E>
<10>;<3B>;<3B>}<7D> %<25> 1<><17><<3C><<3C>$<24>$<24><14> <0B> <0B>M<EFBFBD>*<2A> <20>K<EFBFBD>K<EFBFBD>(:<3A>;<3B><1F>;<3B>;<3B>'=<3D>><3E>%<25><0E> <0E> rFc<01><><00>|jr@t|jt<00>r&|jjdvs|j
dvr |j<00>ddlm}||<01><00>)a<>Intercept routing exceptions and possibly do something else.
In debug mode, intercept a routing redirect and replace it with
an error if the body will be discarded.
With modern Werkzeug this shouldn't occur, since it now uses a
308 status which tells the browser to resend the method and
body.
.. versionchanged:: 2.1
Don't intercept 307 and 308 redirects.
:meta private:
:internal:
><00>3<00>4><00>GET<45>HEAD<41>OPTIONSr)<01>FormDataRoutingRedirect)r<>rB<00>routing_exceptionr<00>code<64>method<6F> debughelpersr<73>)r<>r!r<>s rD<00>raise_routing_exceptionzFlask.raise_routing_exception<6F>sV<00><00>"<15>
<EFBFBD>
<EFBFBD><1D>g<EFBFBD>7<>7<><1F>I<><16>(<28>(<28>-<2D>-<2D><1A>;<3B><16>~<7E>~<7E>!;<3B>;<3B><19>+<2B>+<2B> +<2B>9<>%<25>g<EFBFBD>.<2E>.rFc<01>:<00>d}tr#t|ttj<00><00>}|j <00>}|D]J}||j
vs<01>|j
|D]'}|j |j|<05><00><00><00>)<00>L|j |<03>y)aUpdate the template context with some commonly used variables.
This injects request, session, config and g into the template
context as well as everything template context processors want
to inject. Note that the as of Flask 0.6, the original values
in the context will not be overridden if a context processor
decides to return a value with the same key.
:param context: the context as a dictionary that is updated in place
to add extra variables.
<20>NN)r!r<00>reversed<65>
blueprints<EFBFBD>copy<70>template_context_processorsr<73><00> ensure_sync)r<><00>context<78>names<65>orig_ctxr<78><00>funcs rD<00>update_template_contextzFlask.update_template_context<78>s<><00><00>)0<><05> <13><19>%<25><18>'<27>*<<3C>*<<3C>!=<3D>><3E>E<EFBFBD><1B><<3C><<3C>><3E><08><19> =<3D>D<EFBFBD><13>t<EFBFBD>7<>7<>7<> <20><<3C><<3C>T<EFBFBD>B<>=<3D>D<EFBFBD><1B>N<EFBFBD>N<EFBFBD>#9<>4<EFBFBD>#3<>#3<>D<EFBFBD>#9<>#;<3B><<3C>=<3D> =<3D>
<10><0E><0E>x<EFBFBD> rFc<01>f<00>|td<01>}|jD]}|j|<02><00><00>|S)z<>Returns the shell context for an interactive shell for this
application. This runs all the registered shell context
processors.
.. versionadded:: 0.11
)<02>appr )r <00>shell_context_processorsr<73>)r<>r<><00> processors rD<00>make_shell_contextzFlask.make_shell_contexts6<00><00><1A><01> "<22><02><1D>6<>6<> #<23>I<EFBFBD> <0E>I<EFBFBD>I<EFBFBD>i<EFBFBD>k<EFBFBD> "<22> #<23><11> rFc <01>V<00>tjjd<01>dk(r"t<00>st j
dd<04><05>yt |<04>r5tj<00>dtjvrt<00>|_
|<03>t|<03>|_
|jjd<08>}dx}}|r|jd <09>\}} }|s|r|}nd
}|s|d k(r t|<02>}n|r t|<08>}nd }|jd |j<00>|jd|j<00>|jdd<10>tj |j|j"<00>d dlm}
 |
t)j*t,|<01>||fi|<05><01>d|_y#d|_wxYw)a<>
Runs the application on a local development server.
Do not use ``run()`` in a production setting. It is not intended to
meet security and performance requirements for a production server.
Instead, see :doc:`/deploying/index` for WSGI server recommendations.
If the :attr:`debug` flag is set the server will automatically reload
for code changes and show a debugger in case an exception happened.
If you want to run the application in debug mode, but disable the
code execution on the interactive debugger, you can pass
``use_evalex=False`` as parameter. This will keep the debugger's
traceback screen active, but disable code execution.
It is not recommended to use this function for development with
automatic reloading as this is badly supported. Instead you should
be using the :command:`flask` command line script's ``run`` support.
.. admonition:: Keep in Mind
Flask will suppress any server error with a generic error page
unless it is in debug mode. As such to enable just the
interactive debugger without the code reloading, you have to
invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
Setting ``use_debugger`` to ``True`` without being in debug mode
won't catch any exceptions because there won't be any to
catch.
:param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to
have the server available externally as well. Defaults to
``'127.0.0.1'`` or the host in the ``SERVER_NAME`` config variable
if present.
:param port: the port of the webserver. Defaults to ``5000`` or the
port defined in the ``SERVER_NAME`` config variable if present.
:param debug: if given, enable or disable debug mode. See
:attr:`debug`.
:param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
files to set environment variables. Will also change the working
directory to the directory containing the first file found.
:param options: the options to be forwarded to the underlying Werkzeug
server. See :func:`werkzeug.serving.run_simple` for more
information.
.. versionchanged:: 1.0
If installed, python-dotenv will be used to load environment
variables from :file:`.env` and :file:`.flaskenv` files.
The :envvar:`FLASK_DEBUG` environment variable will override :attr:`debug`.
Threaded mode is enabled by default.
.. versionchanged:: 0.10
The default port is now picked from the ``SERVER_NAME``
variable.
<20>FLASK_RUN_FROM_CLI<4C>truez<65> * Ignoring a call to 'app.run()' that would block the current 'flask' CLI command.
Only call 'app.run()' in an 'if __name__ == "__main__"' guard.<2E>red)<01>fgN<67> FLASK_DEBUGrS<00>:z 127.0.0.1ri<><00> use_reloader<65> use_debugger<65>threadedT)<01>
run_simpleF)r<>r<><00>getr<00>click<63>sechor&r<00> load_dotenvr$r<>r<>r<><00> partitionr<6E><00>
setdefault<EFBFBD>show_server_bannerr<72><00>werkzeug.servingr<67>r<>r<>r<><00>_got_first_request) r<>r<><00>portr<74>r<>r<>r<><00>sn_host<73>sn_port<72>_r<5F>s rD<00>runz Flask.run"si<00><00>B <0E>:<3A>:<3A>><3E>><3E>.<2E> /<2F>6<EFBFBD> 9<>+<2B>-<2D><15> <0B> <0B>+<2B><1D> <12> <13> <1A>;<3B> '<27> <0F>O<EFBFBD>O<EFBFBD> <1D><1D><02>
<EFBFBD>
<EFBFBD>*<2A>+<2B>-<2D><04>
<EFBFBD> <11> <1C><1D>e<EFBFBD><1B>D<EFBFBD>J<EFBFBD><1A>k<EFBFBD>k<EFBFBD>o<EFBFBD>o<EFBFBD>m<EFBFBD>4<> <0B> <20> <20><07>'<27> <16>"-<2D>"7<>"7<><03>"<<3C> <1F>G<EFBFBD>Q<EFBFBD><07><13><16><1E><04>"<22><04> <0F>4<EFBFBD>1<EFBFBD>9<EFBFBD><16>t<EFBFBD>9<EFBFBD>D<EFBFBD> <14><16>w<EFBFBD><<3C>D<EFBFBD><17>D<EFBFBD><0F><1A><1A>><3E>4<EFBFBD>:<3A>:<3A>6<><0F><1A><1A>><3E>4<EFBFBD>:<3A>:<3A>6<><0F><1A><1A>:<3A>t<EFBFBD>,<2C> <0B><1E><1E>t<EFBFBD>z<EFBFBD>z<EFBFBD>4<EFBFBD>9<EFBFBD>9<EFBFBD>5<>/<2F> ,<2C> <16>q<EFBFBD>v<EFBFBD>v<EFBFBD>c<EFBFBD>4<EFBFBD>(<28>$<24><04> @<40><07> @<40>
',<2C>D<EFBFBD> #<23><>e<EFBFBD>D<EFBFBD> #<23>s <00>4#F<00> F(c <01>V<00>|j}|<03>ddlm}|||jfd|i|<02><01>S)a<>Creates a test client for this application. For information
about unit testing head over to :doc:`/testing`.
Note that if you are testing for assertions or exceptions in your
application code, you must set ``app.testing = True`` in order for the
exceptions to propagate to the test client. Otherwise, the exception
will be handled by the application (not visible to the test client) and
the only indication of an AssertionError or other exception will be a
500 status code response to the test client. See the :attr:`testing`
attribute. For example::
app.testing = True
client = app.test_client()
The test client can be used in a ``with`` block to defer the closing down
of the context until the end of the ``with`` block. This is useful if
you want to access the context locals for testing::
with app.test_client() as c:
rv = c.get('/?vodka=42')
assert request.args['vodka'] == '42'
Additionally, you may pass optional keyword arguments that will then
be passed to the application's :attr:`test_client_class` constructor.
For example::
from flask.testing import FlaskClient
class CustomClient(FlaskClient):
def __init__(self, *args, **kwargs):
self._authentication = kwargs.pop("authentication")
super(CustomClient,self).__init__( *args, **kwargs)
app.test_client_class = CustomClient
client = app.test_client(authentication='Basic ....')
See :class:`~flask.testing.FlaskClient` for more information.
.. versionchanged:: 0.4
added support for ``with`` block usage for the client.
.. versionadded:: 0.7
The `use_cookies` parameter was added as well as the ability
to override the client to be used by setting the
:attr:`test_client_class` attribute.
.. versionchanged:: 0.11
Added `**kwargs` to support passing additional keyword arguments to
the constructor of :attr:`test_client_class`.
rr5<00> use_cookies)<04>test_client_class<73>testingr6rk)r<>r<00>kwargs<67>clss rD<00> test_clientzFlask.test_client<6E>s@<00><00>f<13>$<24>$<24><03> <0E>;<3B> 3<><12> <10>$<24>%<25>%<25>
<EFBFBD>3><3E>
<EFBFBD>BH<EFBFBD>
<EFBFBD>
rFc <01><<00>|j}|<02>ddlm}||fi|<01><01>S)a-Create a CLI runner for testing CLI commands.
See :ref:`testing-cli`.
Returns an instance of :attr:`test_cli_runner_class`, by default
:class:`~flask.testing.FlaskCliRunner`. The Flask app object is
passed as the first argument.
.. versionadded:: 1.0
rr7)<03>test_cli_runner_classrr8)r<>rrs rD<00>test_cli_runnerzFlask.test_cli_runner<65>s'<00><00><13>(<28>(<28><03> <0E>;<3B> 6<><12>4<EFBFBD>"<22>6<EFBFBD>"<22>"rFc<01><><00>|j<00>|St|t<00>r|S|j|tj
<00>}|<02>|S|j |<02>|<01>S)acHandles an HTTP exception. By default this will invoke the
registered error handlers and fall back to returning the
exception as response.
.. versionchanged:: 1.0.3
``RoutingException``, used internally for actions such as
slash redirects during routing, is not passed to error
handlers.
.. versionchanged:: 1.0
Exceptions are looked up by code *and* by MRO, so
``HTTPException`` subclasses can be handled with a catch-all
handler for the base ``HTTPException``.
.. versionadded:: 0.3
)r<>rBr<00>_find_error_handlerr!r<>r<><00>r<><00>e<>handlers rD<00>handle_http_exceptionzFlask.handle_http_exception<6F>s^<00><00>* <0A>6<EFBFBD>6<EFBFBD>><3E><14>H<EFBFBD>
<16>a<EFBFBD>)<29> *<2A><14>H<EFBFBD><16>*<2A>*<2A>1<EFBFBD>g<EFBFBD>.@<40>.@<40>A<><07> <12>?<3F><14>H<EFBFBD>(<28>t<EFBFBD><1F><1F><07>(<28><11>+<2B>+rFc<01>><00>t|t<00>r"|js|jdrd|_t|t
<00>r"|j |<01>s|j|<01>S|j|tj<00>}|<02><01>|j|<02>|<01>S)a>This method is called whenever an exception occurs that
should be handled. A special case is :class:`~werkzeug
.exceptions.HTTPException` which is forwarded to the
:meth:`handle_http_exception` method. This function will either
return a response value or reraise the exception with the same
traceback.
.. versionchanged:: 1.0
Key errors raised from request data like ``form`` show the
bad key in debug mode rather than a generic bad request
message.
.. versionadded:: 0.7
rcT) rBr r<>r<><00>show_exceptionr <00>trap_http_exceptionrr
r!r<>r<>r s rD<00>handle_user_exceptionzFlask.handle_user_exception s<><00><00>" <16>a<EFBFBD>+<2B> ,<2C> <10>J<EFBFBD>J<EFBFBD>$<24>+<2B>+<2B>&?<3F>@<40>#<23>A<EFBFBD> <1C> <15>a<EFBFBD><1D> '<27><04>0H<30>0H<30><11>0K<30><17>-<2D>-<2D>a<EFBFBD>0<> 0<><16>*<2A>*<2A>1<EFBFBD>g<EFBFBD>.@<40>.@<40>A<><07> <12>?<3F> <11>(<28>t<EFBFBD><1F><1F><07>(<28><11>+<2B>+rFc<01><><00>tj<00>}tj||j|<01><01>|j
d}|<03>|j xs |j}|r
|d|ur<01>|<01>|j|<02>t|<01><04>}|j|tj<00>}|<05>|j |<05>|<04>}|j|d<05><06>S)a<>Handle an exception that did not have an error handler
associated with it, or that was raised from an error handler.
This always causes a 500 ``InternalServerError``.
Always sends the :data:`got_request_exception` signal.
If :data:`PROPAGATE_EXCEPTIONS` is ``True``, such as in debug
mode, the error will be re-raised so that the debugger can
display it. Otherwise, the original exception is logged, and
an :exc:`~werkzeug.exceptions.InternalServerError` is returned.
If an error handler is registered for ``InternalServerError`` or
``500``, it will be used. For consistency, the handler will
always receive the ``InternalServerError``. The original
unhandled exception is available as ``e.original_exception``.
.. versionchanged:: 1.1.0
Always passes the ``InternalServerError`` instance to the
handler, setting ``original_exception`` to the unhandled
error.
.. versionchanged:: 1.1.0
``after_request`` functions and other finalization is done
even for the default 500 response when there is no handler.
.. versionadded:: 0.3
)<02>_async_wrapper<65> exceptionrKr)<01>original_exceptionT)<01>from_error_handler)<0E>sys<79>exc_infor-<00>sendr<64>r<>rr<><00> log_exceptionr r
r!r<><00>finalize_request)r<>r r<00> propagate<74> server_errorr s rD<00>handle_exceptionzFlask.handle_exception+s<><00><00>8<17><<3C><<3C>><3E><08><1D>"<22>"<22>4<EFBFBD><04>8H<38>8H<38>TU<54>V<><18>K<EFBFBD>K<EFBFBD> 6<>7<> <09> <14> <1C><1C> <0C> <0C>2<><04>
<EFBFBD>
<EFBFBD>I<EFBFBD> <14><18><01>{<7B>a<EFBFBD><1F><15><13>G<EFBFBD> <0C><1A><1A>8<EFBFBD>$<24>*<2A>a<EFBFBD>@<40> <0C><16>*<2A>*<2A><<3C><17>9K<39>9K<39>L<><07> <12> <1E>4<>4<EFBFBD>+<2B>+<2B>G<EFBFBD>4<>\<5C>B<>L<EFBFBD><13>$<24>$<24>\<5C>d<EFBFBD>$<24>K<>KrFc<01><><00>|jjdtj<00>dtj<00>d<03>|<01><04>y)a Logs an exception. This is called by :meth:`handle_exception`
if debugging is disabled and right before the handler is called.
The default implementation logs the exception as error on the
:attr:`logger`.
.. versionadded:: 0.8
z Exception on z [<5B>])rN)<05>logger<65>errorr!r<>r<>)r<>rs rDrzFlask.log_exception`s8<00><00> <0A> <0B> <0B><19><19><1B>G<EFBFBD>L<EFBFBD>L<EFBFBD>><3E><12>G<EFBFBD>N<EFBFBD>N<EFBFBD>+;<3B>1<EFBFBD> =<3D><08> <1A>
rFc<01>@<00>tj}|j<00>|j|<01>|j}t |dd<02>r|j dk(r|j<00>S|j}|j|j|j<00>di|<03><01>S)a<>Does the request dispatching. Matches the URL and returns the
return value of the view or error handler. This does not have to
be a response object. In order to convert the return value to a
proper response object, call :func:`make_response`.
.. versionchanged:: 0.7
This no longer does the exception handling, this code was
moved to the new :meth:`full_dispatch_request`.
<20>provide_automatic_optionsFr<46>rz) r"r!r<>r<><00>url_rule<6C>getattrr<72><00>make_default_options_response<73> view_argsr<73><00>view_functionsr)r<><00>req<65>ruler)s rD<00>dispatch_requestzFlask.dispatch_requestos<><00><00><1A>!<21>!<21><03> <0E> <20> <20> ,<2C> <10> (<28> (<28><13> -<2D><18>\<5C>\<5C><04> <14>D<EFBFBD>5<>u<EFBFBD> =<3D><13>
<EFBFBD>
<EFBFBD>i<EFBFBD>'<27><17>5<>5<>7<> 7<>&)<29>m<EFBFBD>m<EFBFBD> <09>C<>t<EFBFBD><1F><1F><04> 3<> 3<>D<EFBFBD>M<EFBFBD>M<EFBFBD> B<>C<>P<>i<EFBFBD>P<>PrFc<01><00>d|_ tj||j<00><02>|j <00>}|<01>|j <00>}|j|<01>S#t $r}|j|<02>}Yd}~<02>0d}~wwxYw)z<>Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
.. versionadded:: 0.7
T)rN) r<>r/rr<><00>preprocess_requestr-<00> Exceptionrr)r<>r<>r s rD<00>full_dispatch_requestzFlask.full_dispatch_request<73>s}<00><00>#'<27><04><1F> /<2F> <1B> <20> <20><14>d<EFBFBD>6F<36>6F<36> G<><15>(<28>(<28>*<2A>B<EFBFBD><11>z<EFBFBD><19>*<2A>*<2A>,<2C><02><14>$<24>$<24>R<EFBFBD>(<28>(<28><><19> /<2F><15>+<2B>+<2B>A<EFBFBD>.<2E>B<EFBFBD><42> /<2F>s<00>AA<00> B<03>&A<<03><Bc<01><><00>|j|<01>} |j|<03>}tj||j|<03><01>|S#t
$r"|s<01>|j jd<02>Y|SwxYw)a)Given the return value from a view function this finalizes
the request by converting it into a response and invoking the
postprocessing functions. This is invoked for both normal
request dispatching as well as error handlers.
Because this means that it might be called as a result of a
failure a special safe mode is available which can be enabled
with the `from_error_handler` flag. If enabled, failures in
response processing will be logged and otherwise ignored.
:internal:
)r<00>responsez?Request finalizing failed with an error while handling an error)<08> make_response<73>process_responser.rr<>r0r"r)r<>r<>rr3s rDrzFlask.finalize_request<73>s~<00><00>"<18>%<25>%<25>b<EFBFBD>)<29><08>
<0E><1B>,<2C>,<2C>X<EFBFBD>6<>H<EFBFBD> <1C> !<21> !<21><14>T<EFBFBD>%5<>%5<><08> <0E><18><0F><> <19> <0E>%<25><15> <10>K<EFBFBD>K<EFBFBD> !<21> !<21>Q<> <0E><18><0F>  <0E>s<00>3A<00>'A3<03>2A3c<01><><00>tj}|j<00>}|j<00>}|jj |<02>|S)z<>This method is called to create the default ``OPTIONS`` response.
This can be changed through subclassing to change the default
behavior of ``OPTIONS`` responses.
.. versionadded:: 0.7
)r"<00> url_adapter<65>allowed_methodsrk<00>allowr<77>)r<><00>adapter<65>methodsr<73>s rDr(z#Flask.make_default_options_response<73>s@<00><00><1E>)<29>)<29><07><19>)<29>)<29>+<2B><07> <11> <20> <20> "<22><02>
<EFBFBD><08><08><0F><0F><07> <20><11> rFc<01>><00>t|<01>r|j|<01>S|S)a)Ensure that the function is synchronous for WSGI workers.
Plain ``def`` functions are returned as-is. ``async def``
functions are wrapped to run and wait for the response.
Override this method to change how the app runs async views.
.. versionadded:: 2.0
)r<00> async_to_sync)r<>r<>s rDr<>zFlask.ensure_sync<6E>s"<00><00> <1F>t<EFBFBD> $<24><17>%<25>%<25>d<EFBFBD>+<2B> +<2B><13> rFc<01>R<00> ddlm}||<01>S#t$r td<03>d<04>wxYw)a1Return a sync function that will run the coroutine function.
.. code-block:: python
result = app.async_to_sync(func)(*args, **kwargs)
Override this method to change how the app converts async code
to be synchronously callable.
.. versionadded:: 2.0
r)r=zAInstall Flask with the 'async' extra in order to use async views.N)<04> asgiref.syncr=<00> ImportErrorr<72>)r<>r<><00>asgiref_async_to_syncs rDr=zFlask.async_to_sync<6E>s;<00><00> <18> K<> %<25>T<EFBFBD>*<2A>*<2A><> <1B> <18><1E>S<><0E><17> <18> <18>s<00><00>&<03><04>_anchor<6F>_method<6F>_scheme<6D> _externalc <01>V<00>tjd<01>}|<07>?|j}|jj} |dddk(r| <09>| <09>|<01><00>}n|dd}|<05>K|du}nFt jd<01>}
|
<EFBFBD> |
j}n|j d<01>}|<08> td<04><00>|<05>d}|<04> |s td<06><00>|j||<06> |j|||||<05><07>} |<02>t|d <09>
<EFBFBD>}| <0B>d |<02><00>} | S#t$r2} |j||||<05><08>|j| ||<06>cYd} ~ Sd} ~ wwxYw) a Generate a URL to the given endpoint with the given values.
This is called by :func:`flask.url_for`, and can be called
directly as well.
An *endpoint* is the name of a URL rule, usually added with
:meth:`@app.route() <route>`, and usually the same name as the
view function. A route defined in a :class:`~flask.Blueprint`
will prepend the blueprint's name separated by a ``.`` to the
endpoint.
In some cases, such as email messages, you want URLs to include
the scheme and domain, like ``https://example.com/hello``. When
not in an active request, URLs will be external by default, but
this requires setting :data:`SERVER_NAME` so Flask knows what
domain to use. :data:`APPLICATION_ROOT` and
:data:`PREFERRED_URL_SCHEME` should also be configured as
needed. This config is only used when not in an active request.
Functions can be decorated with :meth:`url_defaults` to modify
keyword arguments before the URL is built.
If building fails for some reason, such as an unknown endpoint
or incorrect values, the app's :meth:`handle_url_build_error`
method is called. If that returns a string, that is returned,
otherwise a :exc:`~werkzeug.routing.BuildError` is raised.
:param endpoint: The endpoint name associated with the URL to
generate. If this starts with a ``.``, the current blueprint
name (if any) will be used.
:param _anchor: If given, append this as ``#anchor`` to the URL.
:param _method: If given, generate the URL associated with this
method for the endpoint.
:param _scheme: If given, the URL will have this scheme if it
is external.
:param _external: If given, prefer the URL to be internal
(False) or require it to be external (True). External URLs
include the scheme and domain. When not in an active
request, URLs are external by default.
:param values: Values to use for the variable parts of the URL
rule. Unknown keys are appended as query string arguments,
like ``?a=b&c=d``.
.. versionadded:: 2.2
Moved from ``flask.url_for``, which calls this method.
Nr<00>.z<>Unable to build URLs outside an active request without 'SERVER_NAME' configured. Also configure 'APPLICATION_ROOT' and 'PREFERRED_URL_SCHEME' as needed.Tz4When specifying '_scheme', '_external' must be True.)r<>r<><00>force_externalrBz%!#$&'()*+,/:;=?@)<01>safe<66>#)rr<>r7r!<00> blueprintrr<>r<>r<><00>inject_url_defaults<74>buildrr<><00>handle_url_build_error<6F>
_url_quote) r<>rrCrDrErF<00>values<65>req_ctxr7<00>blueprint_name<6D>app_ctxr<78>r#s rDr<>z Flask.url_for<6F>s<><00><00>r<1E>/<2F>/<2F>$<24>'<27><07> <12> <1E>!<21>-<2D>-<2D>K<EFBFBD>$<24>_<EFBFBD>_<EFBFBD>6<>6<>N<EFBFBD><18><02><11>|<7C>s<EFBFBD>"<22>!<21>-<2D>"0<>!1<>(<28><1A><<3C>H<EFBFBD>'<27><01><02>|<7C>H<EFBFBD><19> <20>#<23>4<EFBFBD>/<2F> <09><1D>k<EFBFBD>k<EFBFBD>$<24>'<27>G<EFBFBD>
<17>"<22>%<25>1<>1<> <0B>"<22>5<>5<>d<EFBFBD>;<3B> <0B><1A>"<22>"<22><1F><12><12><19> <20> <20> <09> <13> <1E>y<EFBFBD><1C>S<>T<> T<> <0C> <20> <20><18>6<EFBFBD>2<> H<01><1C>"<22>"<22><18><16><1E>"<22>(<28> #<23><0E>B<EFBFBD> <13> <1E> <20><17>/B<>C<>G<EFBFBD><16>4<EFBFBD>q<EFBFBD><17> <09>"<22>B<EFBFBD><11> <09><><1A> H<01> <12>M<EFBFBD>M<EFBFBD><1F><17>'<27>Y<EFBFBD> <1A> <0E><18>.<2E>.<2E>u<EFBFBD>h<EFBFBD><06>G<> G<><47>  H<01>s<00>?C-<00>- D(<03>6'D#<03>D(<03>#D(c<01><><00>d}d}t|t<00>rVt|<01>}|dk(r|\}}}n?|dk(r/t|dtttt
f<04>r|\}}n|\}}n t d<05><00>|<01>t dtj<00>d<07><03><00>t||j<00>s<>t|tttf<03>st|tj<00>r|j|||<03><08>}dx}}n<>t|tt
f<02>r|jj!|<01>}nit|t"<00>s t%|<01>r, |jj'|tj(<00>}n"t d t+|<01>j,<00>d
<EFBFBD><03><00>t5j6t8|<01>}|<02>*t|tttf<03>r||_n||_|r|j>jA|<03>|S#t $rN}t |<05>d t+|<01>j,<00>d
<EFBFBD><04>j/t1j2<00>d<00>d<01>d}~wwxYw) a<>Convert the return value from a view function to an instance of
:attr:`response_class`.
:param rv: the return value from the view function. The view function
must return a response. Returning ``None``, or the view ending
without returning, is not allowed. The following types are allowed
for ``view_rv``:
``str``
A response object is created with the string encoded to UTF-8
as the body.
``bytes``
A response object is created with the bytes as the body.
``dict``
A dictionary that will be jsonify'd before being returned.
``list``
A list that will be jsonify'd before being returned.
``generator`` or ``iterator``
A generator that returns ``str`` or ``bytes`` to be
streamed as the response.
``tuple``
Either ``(body, status, headers)``, ``(body, status)``, or
``(body, headers)``, where ``body`` is any of the other types
allowed here, ``status`` is a string or an integer, and
``headers`` is a dictionary or a list of ``(key, value)``
tuples. If ``body`` is a :attr:`response_class` instance,
``status`` overwrites the exiting value and ``headers`` are
extended.
:attr:`response_class`
The object is returned unchanged.
other :class:`~werkzeug.wrappers.Response` class
The object is coerced to :attr:`response_class`.
:func:`callable`
The function is called as a WSGI application. The result is
used to create a response object.
.. versionchanged:: 2.2
A generator will be converted to a streaming response.
A list will be converted to a JSON response.
.. versionchanged:: 1.1
A dict will be converted to a JSON response.
.. versionchanged:: 0.9
Previously a tuple was interpreted as the arguments for the
response object.
N<><00>rz<>The view function did not return a valid response tuple. The tuple must have the form (body, status, headers), (body, status), or (body, headers).zThe view function for zh did not return a valid response. The function either returned None or ended without a return statement.)<02>status<75>headersz<73>
The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a rHz<>The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a )!rB<00>tuple<6C>lenr r<><00>list<73> TypeErrorr!rrkr<><00>bytes<65> bytearray<61>cabc<62>Iteratorr<72>r3<00> BaseResponse<73>callable<6C>
force_typer<EFBFBD><00>type<70>__name__<5F>with_tracebackrrr<>r<>rrX<00> status_coderYr<>)r<>r<>rXrY<00>len_rvr s rDr4zFlask.make_responseis;<00><00>r"<22><06>'+<2B><07> <16>b<EFBFBD>%<25> <20><18><12>W<EFBFBD>F<EFBFBD><16><11>{<7B>&(<28>#<23><02>F<EFBFBD>G<EFBFBD><17>1<EFBFBD><1B><1D>b<EFBFBD><11>e<EFBFBD>g<EFBFBD>t<EFBFBD>U<EFBFBD>D<EFBFBD>%A<>B<>"$<24>K<EFBFBD>B<EFBFBD><07>!#<23>J<EFBFBD>B<EFBFBD><06> <20>;<3B><12><12> <0E>:<3A><1B>(<28><17>)9<>)9<>(<<3C>==<3D>=<3D><0E> <0E><1A>"<22>d<EFBFBD>1<>1<>2<><19>"<22>s<EFBFBD>E<EFBFBD>9<EFBFBD>5<>6<>*<2A>R<EFBFBD><14><1D><1D>:W<><1A>(<28>(<28><16>!<21>#<23>)<29><12><02>
$(<28>'<27><06><17><1B>B<EFBFBD><14>t<EFBFBD> <0C>-<2D><19>Y<EFBFBD>Y<EFBFBD>'<27>'<27><02>+<2B><02><1B>B<EFBFBD> <0C>-<2D><18>"<22><1C> B<01><1D>,<2C>,<2C>7<>7<><1A><1F><0F><0F><16>B<EFBFBD> <20><18><1D>R<EFBFBD><08>)<29>)<29>*<2A>!<21> -<2D><12><12><0F>V<EFBFBD>V<EFBFBD>H<EFBFBD>b<EFBFBD> !<21><02> <11> <1D><19>&<26>3<EFBFBD><05>y<EFBFBD>"9<>:<3A>"<22><02> <09>!'<27><02><0E> <13> <0E>J<EFBFBD>J<EFBFBD> <1D> <1D>g<EFBFBD> &<26><11> <09><>;!<21>B<01>#<23><1C>#<23>"<22>#'<27>r<EFBFBD>(<28>"3<>"3<>!4<>A<EFBFBD> 7<><16> %<25>n<EFBFBD>S<EFBFBD>\<5C>\<5C>^<5E>A<EFBFBD>%6<>7<>T<EFBFBD> B<01><>B<01>s<00><*G.<00>. I<03>7A I<03>Ic<01>l<00>dgttj<00><00><01>}|D]J}||jvs<01>|j|D]'}|tjtj
<00><00>)<00>L|D]C}||j vs<01>|j |D] }|j|<04><00>}|<05><01>|ccS<00>Ey)a<>Called before the request is dispatched. Calls
:attr:`url_value_preprocessors` registered with the app and the
current blueprint (if any). Then calls :attr:`before_request_funcs`
registered with the app and the blueprint.
If any :meth:`before_request` handler returns a non-None value, the
value is handled as if it was the return value from the view, and
further request handling is stopped.
N)r<>r!r<><00>url_value_preprocessorsrr)<00>before_request_funcsr<73>)r<>r<>r<><00>url_func<6E> before_funcr<63>s rDr/zFlask.preprocess_request<73>s<><00><00><16>5<><08><17>!3<>!3<>4<>5<><05><19> B<01>D<EFBFBD><13>t<EFBFBD>3<>3<>3<> $<24> <<3C> <<3C>T<EFBFBD> B<>B<01>H<EFBFBD><1C>W<EFBFBD>-<2D>-<2D>w<EFBFBD>/@<40>/@<40>A<>B<01> B<01>
<1A> "<22>D<EFBFBD><13>t<EFBFBD>0<>0<>0<>#'<27>#<<3C>#<<3C>T<EFBFBD>#B<>"<22>K<EFBFBD>6<><14>)<29>)<29>+<2B>6<>8<>B<EFBFBD><19>~<7E>!<21> <09> "<22> "<22>rFc<01><><00>tj<00>}|jD]}|j|<03>|<01>}<01>t t
j d<01>D]E}||jvs<01>t|j|<00>D]}|j|<03>|<01>}<01><00>G|jj|j<00>s'|jj||j|<01>|S)aCan be overridden in order to modify the response object
before it's sent to the WSGI server. By default this will
call all the :meth:`after_request` decorated functions.
.. versionchanged:: 0.5
As of Flask 0.5 the functions registered for after request
execution are called in reverse order of registration.
:param response: a :attr:`response_class` object.
:return: a new response object or the same, has to be an
instance of :attr:`response_class`.
r<>) r"<00>_get_current_object<63>_after_request_functionsr<73>rr!r<><00>after_request_funcsr<73>rl<00>is_null_sessionr#<00> save_session)r<>r3<00>ctxr<78>r<>s rDr5zFlask.process_responses<><00><00><1A>-<2D>-<2D>/<2F><03><17>0<>0<> 8<>D<EFBFBD>-<2D>t<EFBFBD>'<27>'<27><04>-<2D>h<EFBFBD>7<>H<EFBFBD> 8<><1A>'<27>,<2C>,<2C>g<EFBFBD>6<> @<01>D<EFBFBD><13>t<EFBFBD>/<2F>/<2F>/<2F>$<24>T<EFBFBD>%=<3D>%=<3D>d<EFBFBD>%C<>D<>@<01>D<EFBFBD>5<>t<EFBFBD>/<2F>/<2F><04>5<>h<EFBFBD>?<3F>H<EFBFBD>@<01> @<01>
<14>%<25>%<25>5<>5<>c<EFBFBD>k<EFBFBD>k<EFBFBD>B<> <10> "<22> "<22> /<2F> /<2F><04>c<EFBFBD>k<EFBFBD>k<EFBFBD>8<EFBFBD> L<><17>rFc<01>J<00>|turtj<00>d}ttj
d<02>D]E}||j vs<01>t|j |<00>D]}|j|<03>|<01><00><00>Gtj||j|<01><03>y)a2Called after the request is dispatched and the response is
returned, right before the request context is popped.
This calls all functions decorated with
:meth:`teardown_request`, and :meth:`Blueprint.teardown_request`
if a blueprint handled the request. Finally, the
:data:`request_tearing_down` signal is sent.
This is called by
:meth:`RequestContext.pop() <flask.ctx.RequestContext.pop>`,
which may be delayed during testing to maintain access to
resources.
:param exc: An unhandled exception raised while dispatching the
request. Detected from the current exception information if
not passed. Passed to each teardown function.
.. versionchanged:: 0.9
Added the ``exc`` argument.
rr<><00>r<00>excN) r)rrrr!r<><00>teardown_request_funcsr<73>r<>r0r)r<>rxr<>r<>s rD<00>do_teardown_requestzFlask.do_teardown_request.s<><00><00>0 <0F>)<29> <1B><15>,<2C>,<2C>.<2E><11>#<23>C<EFBFBD><19>'<27>,<2C>,<2C>g<EFBFBD>6<> 0<>D<EFBFBD><13>t<EFBFBD>2<>2<>2<>$<24>T<EFBFBD>%@<40>%@<40><14>%F<>G<>0<>D<EFBFBD>*<2A>D<EFBFBD>$<24>$<24>T<EFBFBD>*<2A>3<EFBFBD>/<2F>0<> 0<>
<1D>!<21>!<21>$<24>t<EFBFBD>7G<37>7G<37>S<EFBFBD>QrFc<01><><00>|turtj<00>d}t|j<00>D]}|j |<02>|<01><00>t j||j
|<01><02>y)a<>Called right before the application context is popped.
When handling a request, the application context is popped
after the request context. See :meth:`do_teardown_request`.
This calls all functions decorated with
:meth:`teardown_appcontext`. Then the
:data:`appcontext_tearing_down` signal is sent.
This is called by
:meth:`AppContext.pop() <flask.ctx.AppContext.pop>`.
.. versionadded:: 0.9
rrwN)r)rrr<><00>teardown_appcontext_funcsr<73>r,r)r<>rxr<>s rD<00>do_teardown_appcontextzFlask.do_teardown_appcontextPsf<00><00>$ <0F>)<29> <1B><15>,<2C>,<2C>.<2E><11>#<23>C<EFBFBD><1C>T<EFBFBD>;<3B>;<3B><<3C> (<28>D<EFBFBD> "<22>D<EFBFBD> <1C> <1C>T<EFBFBD> "<22>3<EFBFBD> '<27> (<28> <20>$<24>$<24>T<EFBFBD>$<24>:J<>:J<>PS<50>TrFc<01><00>t|<00>S)aFCreate an :class:`~flask.ctx.AppContext`. Use as a ``with``
block to push the context, which will make :data:`current_app`
point at this application.
An application context is automatically pushed by
:meth:`RequestContext.push() <flask.ctx.RequestContext.push>`
when handling a request, and when running a CLI command. Use
this to manually create a context outside of these situations.
::
with app.app_context():
init_db()
See :doc:`/appcontext`.
.. versionadded:: 0.9
r)r<>s rD<00> app_contextzFlask.app_contextjs<00><00>&<1A>$<24><1F>rFc<01><00>t||<01>S)a$Create a :class:`~flask.ctx.RequestContext` representing a
WSGI environment. Use a ``with`` block to push the context,
which will make :data:`request` point at this request.
See :doc:`/reqcontext`.
Typically you should not call this from your own code. A request
context is automatically pushed by the :meth:`wsgi_app` when
handling a request. Use :meth:`test_request_context` to create
an environment and context instead of this method.
:param environ: a WSGI environment
r)r<>r<>s rD<00>request_contextzFlask.request_contexts<00><00><1E>d<EFBFBD>G<EFBFBD>,<2C>,rFc<01><><00>ddlm}||g|<01><01>i|<02><01>} |j|j<00><00>|j <00>S#|j <00>wxYw)a<>Create a :class:`~flask.ctx.RequestContext` for a WSGI
environment created from the given values. This is mostly useful
during testing, where you may want to run a function that uses
request data without dispatching a full request.
See :doc:`/reqcontext`.
Use a ``with`` block to push the context, which will make
:data:`request` point at the request for the created
environment. ::
with app.test_request_context(...):
generate_report()
When using the shell, it may be easier to push and pop the
context manually to avoid indentation. ::
ctx = app.test_request_context(...)
ctx.push()
...
ctx.pop()
Takes the same arguments as Werkzeug's
:class:`~werkzeug.test.EnvironBuilder`, with some defaults from
the application. See the linked Werkzeug docs for most of the
available arguments. Flask-specific behavior is listed here.
:param path: URL path being requested.
:param base_url: Base URL where the app is being served, which
``path`` is relative to. If not given, built from
:data:`PREFERRED_URL_SCHEME`, ``subdomain``,
:data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.
:param subdomain: Subdomain name to append to
:data:`SERVER_NAME`.
:param url_scheme: Scheme to use instead of
:data:`PREFERRED_URL_SCHEME`.
:param data: The request body, either as a string or a dict of
form keys and values.
:param json: If given, this is serialized as JSON and passed as
``data``. Also defaults ``content_type`` to
``application/json``.
:param args: other positional arguments passed to
:class:`~werkzeug.test.EnvironBuilder`.
:param kwargs: other keyword arguments passed to
:class:`~werkzeug.test.EnvironBuilder`.
r)<01>EnvironBuilder)rr<>r<><00> get_environ<6F>close)r<><00>argsrr<><00>builders rD<00>test_request_contextzFlask.test_request_context<78>sK<00><00>^ ,<2C> <20><14>7<><04>7<><06>7<><07> <1C><17>'<27>'<27><07>(;<3B>(;<3B>(=<3D>><3E> <13>M<EFBFBD>M<EFBFBD>O<EFBFBD><4F>G<EFBFBD>M<EFBFBD>M<EFBFBD>O<EFBFBD>s <00>A<00>Ac<01><><00>|j|<01>}d} |j<00>|j<00>}|||<02>d|vr:|dtj<00><00>|dtj<00><00>|<04>|j|<04>rd}|j|<04>S#t$r}|}|j |<06>}Yd}~<06><>d}~wt j <00>d}<04>xYw#d|vr:|dtj<00><00>|dtj<00><00>|<04>|j|<04>rd}|j|<04>wxYw)a<>The actual WSGI application. This is not implemented in
:meth:`__call__` so that middlewares can be applied without
losing a reference to the app object. Instead of doing this::
app = MyMiddleware(app)
It's a better idea to do this instead::
app.wsgi_app = MyMiddleware(app.wsgi_app)
Then you still have the original application object around and
can continue to call methods on it.
.. versionchanged:: 0.7
Teardown events for the request and app contexts are called
even if an unhandled error occurs. Other events may not be
called depending on when an error occurs during dispatch.
See :ref:`callbacks-and-errors`.
:param environ: A WSGI environment.
:param start_response: A callable accepting a status code,
a list of headers, and an optional exception context to
start the response.
Nrzwerkzeug.debug.preserve_context) r<><00>pushr1r0rrrrr<>r<00>should_ignore_error<6F>pop)r<>r<><00>start_responserur#r3r s rD<00>wsgi_appzFlask.wsgi_app<70>s3<00><00>6<13>"<22>"<22>7<EFBFBD>+<2B><03>&*<2A><05> <1B> <16><13><08><08>
<EFBFBD><1F>5<>5<>7<><08><1C>G<EFBFBD>^<5E>4<>0<>G<EFBFBD>;<3B>:<3A><07>9<>:<3A>7<EFBFBD>;<3B>;<3B>=<3D>I<>:<3A><07>9<>:<3A>;<3B>?<3F>?<3F>;L<>M<><14> <20>T<EFBFBD>%=<3D>%=<3D>e<EFBFBD>%D<><1C><05> <0F>G<EFBFBD>G<EFBFBD>E<EFBFBD>N<EFBFBD><4E><1D> 4<><19><05><1F>0<>0<><11>3<><08><> <16><1B> <0C> <0C><0E>q<EFBFBD>)<29><05><15><>1<>G<EFBFBD>;<3B>:<3A><07>9<>:<3A>7<EFBFBD>;<3B>;<3B>=<3D>I<>:<3A><07>9<>:<3A>;<3B>?<3F>?<3F>;L<>M<><14> <20>T<EFBFBD>%=<3D>%=<3D>e<EFBFBD>%D<><1C><05> <0F>G<EFBFBD>G<EFBFBD>E<EFBFBD>N<EFBFBD>s/<00> B#<00>C$<00># C!<03>,C<03>?C$<00>C!<03>!C$<00>$A&E
c<01>&<00>|j||<02>S)z<>The WSGI server calls the Flask application object as the
WSGI application. This calls :meth:`wsgi_app`, which can be
wrapped to apply middleware.
)r<>)r<>r<>r<>s rD<00>__call__zFlask.__call__<5F>s<00><00><14>}<7D>}<7D>W<EFBFBD>n<EFBFBD>5<>5rF) NrxNFF<46> templatesNFN)rnr<>ro<00>
str | Nonerp<00>str | os.PathLike[str] | Nonerqr<>rrr<>rsr<>rtr<>rur<>rvr<>rwr<>)r<>r<><00>return<72>
int | None)r<>r<>r<>r)r<>N)r<>r<>r<>r<>r<>r<>r<>zt.IO[t.AnyStr])r<>zutf-8)r<>r1)r!zRequest | Noner<65>zMapAdapter | None)r!r2r<>z
t.NoReturn)r<><00>dict[str, t.Any]r<><00>None)r<>r<>)NNNT) r<>r<>r<>r<>r<><00> bool | Noner<65>r<>r<><00>t.Anyr<79>r<>)T)rr<>rr<>r<>r6)rr<>r<>r8)r r r<><00>&HTTPException | ft.ResponseReturnValue)r r0r<>r<>)r r0r<>r)rzCtuple[type, BaseException, TracebackType] | tuple[None, None, None]r<>r<>)r<><00>ft.ResponseReturnValue)r<>r)F)r<>z&ft.ResponseReturnValue | HTTPExceptionrr<>r<>r)r<><00>t.Callable[..., t.Any]r<>r<>)r<>z1t.Callable[..., t.Coroutine[t.Any, t.Any, t.Any]]r<>r<>)rr<>rCr<>rDr<>rEr<>rFr<>rQr<>r<>r<>)r<>r<>r<>r)r<>zft.ResponseReturnValue | None)r3rr<>r)rxzBaseException | Noner<65>r<>)r<>r)r<>r4r<>r)r<>r<>rr<>r<>r)r<>r4r<>r3r<>zcabc.Iterable[bytes])2rf<00>
__module__<EFBFBD> __qualname__<5F>__doc__r
r<00>default_configr2rj<00>__annotations__rrkr*rlr<>r<>r{r<>r<>r<>r<>r<>r<>r<>r<>rrrrrrr-r1rr(r<>r=r<>r4r/r5r)rzr}rr<>r<>r<>r<><00> __classcell__)r<>s@rDrHrHQs8<00><><00>^<08>@#<23>
<EFBFBD> <13>T<EFBFBD>
<EFBFBD> <15>u<EFBFBD>
<EFBFBD> #<23>D<EFBFBD>
<EFBFBD> <19>$<24> 
<EFBFBD>
#<23>D<EFBFBD> 
<EFBFBD> )<29>)<29><12>*<<3C> 
<EFBFBD> <1D>e<EFBFBD>
<EFBFBD> <1C>T<EFBFBD>
<EFBFBD> <1A>4<EFBFBD>
<EFBFBD> <1F><03>
<EFBFBD> "<22>9<EFBFBD>
<EFBFBD> $<24>T<EFBFBD>
<EFBFBD> "<22>4<EFBFBD>
<EFBFBD> &<26>t<EFBFBD>
<EFBFBD> $<24>U<EFBFBD>
<EFBFBD> )<29>%<25>!
<EFBFBD>" &<26>t<EFBFBD>#
<EFBFBD>$-1<>"&<26>$+<2B>#<23>)-<2D>'+<2B>$)<29>(-<2D>$*<2A>%)<29>#<23>)-<2D>;
<EFBFBD> <06>N<EFBFBD>H$+<2B>M<EFBFBD>=<3D>*<2A>&.<2E>N<EFBFBD>N<EFBFBD>-<2D> +G<01>*H<><15>'<27>H<>
'+<2B>7?<3F>"&<26>#<23>#(<28>9D<39>$(<28>).<2E> $<24>5<0E><18>5<0E>$<24>5<0E>5<> 5<0E>
 <20> 5<0E> <1C> 5<0E>!<21>5<0E>7<>5<0E>"<22>5<0E>#'<27>5<0E><1E>5<0E>n<15>6
<EFBFBD>.GK<01>3<><1B>3<>#&<26>3<>9C<39>3<> <17>3<>DGN<01>3<><1B>3<>#&<26>3<>9C<39>3<> <17>3<>,&<12>P3<14>j/<2F>8!<21>8
<12> <20><1F>!<21> <20> y,<2C><18>y,<2C><19>y,<2C><1B> y,<2C>
<1A> y,<2C> <19> y,<2C>
<0E>y,<2C>v8
<EFBFBD>t#<23>"!,<2C><1E>!,<2C> /<2F>!,<2C>F,<2C><1A>,<2C> /<2F>,<2C>@3L<01>j 
<EFBFBD>V<> 
<EFBFBD>
<0E> 
<EFBFBD>Q<01>2)<29>*$)<29><18> 2<><18>!<21><18>
<12> <18>> <12> <14>+<2B>E<>+<2B> <1F>+<2B>8#<23>"<22>"<22>!%<25>|<12><16>|<12>
<1C> |<12> <1C> |<12><1C>|<12><1F>|<12><18>|<12>
<0A>|<12>|L<12>\<14>6<18><%.<2E> R<01> !<21> R<01>
<0E> R<01>H%.<2E>U<01> !<21>U<01>
<0E>U<01>4 <20>*-<2D> 6<1C>p0<1B>&<26>0<1B>8E<38>0<1B> <1D>0<1B>d6<>&<26>6<>8E<38>6<> <1D>6rFrH)rCztimedelta | int | Noner<65>ztimedelta | None)c<>
__future__r<00>collections.abc<62>abcr`r<>rrr<>r<><00>datetimer<00>inspectr<00> itertoolsr<00>typesr<00> urllib.parserrPr<><00>werkzeug.datastructuresr r
<00>werkzeug.exceptionsr r r <00>werkzeug.routingrrrrrr<>r<00>werkzeug.wrappersrrb<00> werkzeug.wsgirr<>r<00>ftrurrr<>rrrr r!r"r#<00>helpersr$r%r&r'<00>
sansio.appr(<00>sansio.scaffoldr)<00>sessionsr*r+<00>signalsr,r-r.r/r0<00>
templatingr1<00>wrappersr2<00> TYPE_CHECKING<4E>_typeshed.wsgir3r4rr6r8r9<00>TypeVar<61>ShellContextProcessorCallabler:<00>TeardownCallabler<<00>TemplateFilterCallabler=<00>TemplateGlobalCallabler><00>TemplateTestCallabler?rErHrzrFrD<00><module>r<>sM<00><01>"<22><1E> <09>
<EFBFBD><12><0E><1E>'<27><1B><1F>,<2C> <0C>+<2B>1<>2<>-<2D>3<>'<27>'<27>,<2C>-<2D>!<21>5<>6<>"<22><11><1A><1B><1F><1C> <20> <20><16><1C> <20><1C>#<23>)<29>$<24>(<28><1B>&<26>2<>&<26>,<2C>*<2A>%<25>$<24>)<29>#<23><1D><1E><04>?<3F>?<3F>,<2C>.<2E>$<24>'<27>$<24>%<25>A<EFBFBD>I<EFBFBD>I<EFBFBD><1F>r<EFBFBD>'G<>'G<><02><19><17>Q<EFBFBD>Y<EFBFBD>Y<EFBFBD>|<7C>2<EFBFBD>+><3E>+><3E> ?<3F>
<EFBFBD><1D>A<EFBFBD>I<EFBFBD>I<EFBFBD>1<><12>9R<39>9R<39>S<><11><1D>A<EFBFBD>I<EFBFBD>I<EFBFBD>1<><12>9R<39>9R<39>S<><11><1B>!<21>)<29>)<29>-<2D>R<EFBFBD>5L<35>5L<35>M<><0F>$<24>o6<>C<EFBFBD>o6rF