2010-07-02 14:20:58 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
flask
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
|
A microframework based on Werkzeug. It's extensively documented
|
|
|
|
|
and follows best practice patterns.
|
|
|
|
|
|
2018-02-08 10:57:40 -08:00
|
|
|
:copyright: © 2010 by the Pallets team.
|
2010-07-02 14:20:58 -04:00
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
|
"""
|
|
|
|
|
|
2019-05-06 15:39:41 -04:00
|
|
|
__version__ = "1.1.dev"
|
2011-06-27 00:31:24 +02:00
|
|
|
|
2010-07-02 14:20:58 -04:00
|
|
|
# utilities we import from Werkzeug and Jinja2 that are unused
|
|
|
|
|
# in the module but are exported as public interface.
|
2011-07-15 18:03:48 +02:00
|
|
|
from werkzeug.exceptions import abort
|
|
|
|
|
from werkzeug.utils import redirect
|
2010-07-02 14:20:58 -04:00
|
|
|
from jinja2 import Markup, escape
|
|
|
|
|
|
2010-07-04 20:00:23 +02:00
|
|
|
from .app import Flask, Request, Response
|
|
|
|
|
from .config import Config
|
2019-05-06 15:39:41 -04:00
|
|
|
from .helpers import (
|
|
|
|
|
url_for,
|
|
|
|
|
flash,
|
|
|
|
|
send_file,
|
|
|
|
|
send_from_directory,
|
|
|
|
|
get_flashed_messages,
|
|
|
|
|
get_template_attribute,
|
|
|
|
|
make_response,
|
|
|
|
|
safe_join,
|
|
|
|
|
stream_with_context,
|
|
|
|
|
)
|
|
|
|
|
from .globals import (
|
|
|
|
|
current_app,
|
|
|
|
|
g,
|
|
|
|
|
request,
|
|
|
|
|
session,
|
|
|
|
|
_request_ctx_stack,
|
|
|
|
|
_app_ctx_stack,
|
|
|
|
|
)
|
|
|
|
|
from .ctx import (
|
|
|
|
|
has_request_context,
|
|
|
|
|
has_app_context,
|
|
|
|
|
after_this_request,
|
|
|
|
|
copy_current_request_context,
|
|
|
|
|
)
|
2011-05-29 20:05:39 +02:00
|
|
|
from .blueprints import Blueprint
|
2010-07-04 20:00:23 +02:00
|
|
|
from .templating import render_template, render_template_string
|
2010-07-04 17:21:13 +02:00
|
|
|
|
2010-07-17 14:39:28 +02:00
|
|
|
# the signals
|
2019-05-06 15:39:41 -04:00
|
|
|
from .signals import (
|
|
|
|
|
signals_available,
|
|
|
|
|
template_rendered,
|
|
|
|
|
request_started,
|
|
|
|
|
request_finished,
|
|
|
|
|
got_request_exception,
|
|
|
|
|
request_tearing_down,
|
|
|
|
|
appcontext_tearing_down,
|
|
|
|
|
appcontext_pushed,
|
|
|
|
|
appcontext_popped,
|
|
|
|
|
message_flashed,
|
|
|
|
|
before_render_template,
|
|
|
|
|
)
|
2010-07-17 14:39:28 +02:00
|
|
|
|
2012-10-07 23:31:48 +02:00
|
|
|
# We're not exposing the actual json module but a convenient wrapper around
|
|
|
|
|
# it.
|
|
|
|
|
from . import json
|
|
|
|
|
|
2016-11-01 22:52:32 -03:00
|
|
|
# This was the only thing that Flask used to export at one point and it had
|
2012-10-07 23:31:48 +02:00
|
|
|
# a more generic name.
|
|
|
|
|
jsonify = json.jsonify
|