doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
before_app_first_request(f)
Like Flask.before_first_request(). Such a function is executed before the first request to the application. Parameters
f (Callable[[], None]) – Return type
Callable[[], None] | flask.api.index#flask.Blueprint.before_app_first_request |
before_app_request(f)
Like Flask.before_request(). Such a function is executed before each request, even if outside of a blueprint. Parameters
f (Callable[[], None]) – Return type
Callable[[], None] | flask.api.index#flask.Blueprint.before_app_request |
before_request(f)
Register a function to run before each request. For example, this can be used to open a database connection, or to load the logged in user from the session. @app.before_request
def load_user():
if "user_id" in session:
g.user = db.session.get(session["user_id"])
The function will be cal... | flask.api.index#flask.Blueprint.before_request |
before_request_funcs: t.Dict[AppOrBlueprintKey, t.List[BeforeRequestCallable]]
A data structure of functions to call at the beginning of each request, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all requests. To register a function, use the be... | flask.api.index#flask.Blueprint.before_request_funcs |
cli
The Click command group for registering CLI commands for this object. The commands are available from the flask command once the application has been discovered and blueprints have been registered. | flask.api.index#flask.Blueprint.cli |
context_processor(f)
Registers a template context processor function. Parameters
f (Callable[[], Dict[str, Any]]) – Return type
Callable[[], Dict[str, Any]] | flask.api.index#flask.Blueprint.context_processor |
delete(rule, **options)
Shortcut for route() with methods=["DELETE"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Blueprint.delete |
endpoint(endpoint)
Decorate a view function to register it for the given endpoint. Used if a rule is added without a view_func with add_url_rule(). app.add_url_rule("/ex", endpoint="example")
@app.endpoint("example")
def example():
...
Parameters
endpoint (str) – The endpoint name to associate with the view f... | flask.api.index#flask.Blueprint.endpoint |
errorhandler(code_or_exception)
Register a function to handle errors by code or exception class. A decorator that is used to register a function given an error code. Example: @app.errorhandler(404)
def page_not_found(error):
return 'This page does not exist', 404
You can also register handlers for arbitrary exce... | flask.api.index#flask.Blueprint.errorhandler |
error_handler_spec: t.Dict[AppOrBlueprintKey, t.Dict[t.Optional[int], t.Dict[t.Type[Exception], ErrorHandlerCallable]]]
A data structure of registered error handlers, in the format {scope: {code: {class: handler}}}`. The scope key is the name of a blueprint the handlers are active for, or None for all requests. The c... | flask.api.index#flask.Blueprint.error_handler_spec |
get(rule, **options)
Shortcut for route() with methods=["GET"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Blueprint.get |
get_send_file_max_age(filename)
Used by send_file() to determine the max_age cache value for a given file path if it wasn’t passed. By default, this returns SEND_FILE_MAX_AGE_DEFAULT from the configuration of current_app. This defaults to None, which tells the browser to use conditional requests instead of a timed ca... | flask.api.index#flask.Blueprint.get_send_file_max_age |
import_name
The name of the package or module that this object belongs to. Do not change this once it is set by the constructor. | flask.api.index#flask.Blueprint.import_name |
json_decoder: Optional[Type[json.decoder.JSONDecoder]] = None
Blueprint local JSON decoder class to use. Set to None to use the app’s json_decoder. | flask.api.index#flask.Blueprint.json_decoder |
json_encoder: Optional[Type[json.encoder.JSONEncoder]] = None
Blueprint local JSON encoder class to use. Set to None to use the app’s json_encoder. | flask.api.index#flask.Blueprint.json_encoder |
make_setup_state(app, options, first_registration=False)
Creates an instance of BlueprintSetupState() object that is later passed to the register callback functions. Subclasses can override this to return a subclass of the setup state. Parameters
app (Flask) –
options (dict) –
first_registration (bool) – R... | flask.api.index#flask.Blueprint.make_setup_state |
open_resource(resource, mode='rb')
Open a resource file relative to 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: with app.open_resource("schema.sql") as f:
conn.executescript(f.read())
Parameters
resource (str) – ... | flask.api.index#flask.Blueprint.open_resource |
patch(rule, **options)
Shortcut for route() with methods=["PATCH"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Blueprint.patch |
post(rule, **options)
Shortcut for route() with methods=["POST"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Blueprint.post |
put(rule, **options)
Shortcut for route() with methods=["PUT"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Blueprint.put |
record(func)
Registers a function that is called when the blueprint is registered on the application. This function is called with the state as argument as returned by the make_setup_state() method. Parameters
func (Callable) – Return type
None | flask.api.index#flask.Blueprint.record |
record_once(func)
Works like record() but wraps the function in another function that will ensure the function is only called once. If the blueprint is registered a second time on the application, the function passed is not called. Parameters
func (Callable) – Return type
None | flask.api.index#flask.Blueprint.record_once |
register(app, options)
Called by Flask.register_blueprint() to register all views and callbacks registered on the blueprint with the application. Creates a BlueprintSetupState and calls each record() callbackwith it. Parameters
app (Flask) – The application this blueprint is being registered with.
options (dict)... | flask.api.index#flask.Blueprint.register |
register_blueprint(blueprint, **options)
Register a Blueprint on this blueprint. Keyword arguments passed to this method will override the defaults set on the blueprint. New in version 2.0. Parameters
blueprint (flask.blueprints.Blueprint) –
options (Any) – Return type
None | flask.api.index#flask.Blueprint.register_blueprint |
register_error_handler(code_or_exception, f)
Alternative error attach function to the errorhandler() decorator that is more straightforward to use for non decorator usage. Changelog New in version 0.7. Parameters
code_or_exception (Union[Type[Exception], int]) –
f (Callable[[Exception], Union[Response, AnyStr... | flask.api.index#flask.Blueprint.register_error_handler |
root_path
Absolute path to the package on the filesystem. Used to look up resources contained in the package. | flask.api.index#flask.Blueprint.root_path |
route(rule, **options)
Decorate a view function to register it with the given URL rule and options. Calls add_url_rule(), which has more details about the implementation. @app.route("/")
def index():
return "Hello, World!"
See URL Route Registrations. The endpoint name for the route defaults to the name of the v... | flask.api.index#flask.Blueprint.route |
send_static_file(filename)
The view function used to serve files from static_folder. A route is automatically registered for this view at static_url_path if static_folder is set. Changelog New in version 0.5. Parameters
filename (str) – Return type
Response | flask.api.index#flask.Blueprint.send_static_file |
teardown_app_request(f)
Like Flask.teardown_request() but for a blueprint. Such a function is executed when tearing down each request, even if outside of the blueprint. Parameters
f (Callable[[Optional[BaseException]], Response]) – Return type
Callable[[Optional[BaseException]], Response] | flask.api.index#flask.Blueprint.teardown_app_request |
teardown_request(f)
Register a function to be run at the end of each request, regardless of whether there was an exception or not. These functions are executed when the request context is popped, even if not an actual request was performed. Example: ctx = app.test_request_context()
ctx.push()
...
ctx.pop()
When ctx.... | flask.api.index#flask.Blueprint.teardown_request |
teardown_request_funcs: t.Dict[AppOrBlueprintKey, t.List[TeardownCallable]]
A data structure of functions to call at the end of each request even if an exception is raised, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all requests. To register ... | flask.api.index#flask.Blueprint.teardown_request_funcs |
template_context_processors: t.Dict[AppOrBlueprintKey, t.List[TemplateContextProcessorCallable]]
A data structure of functions to call to pass extra context values when rendering templates, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all reque... | flask.api.index#flask.Blueprint.template_context_processors |
template_folder
The path to the templates folder, relative to root_path, to add to the template loader. None if templates should not be added. | flask.api.index#flask.Blueprint.template_folder |
url_defaults(f)
Callback function for URL defaults for all view functions of the application. It’s called with the endpoint and values and should update the values passed in place. Parameters
f (Callable[[str, dict], None]) – Return type
Callable[[str, dict], None] | flask.api.index#flask.Blueprint.url_defaults |
url_default_functions: t.Dict[AppOrBlueprintKey, t.List[URLDefaultCallable]]
A data structure of functions to call to modify the keyword arguments when generating URLs, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all requests. To register a fu... | flask.api.index#flask.Blueprint.url_default_functions |
url_value_preprocessor(f)
Register a URL value preprocessor function for all view functions in the application. These functions will be called before the before_request() functions. The function can modify the values captured from the matched url before they are passed to the view. For example, this can be used to po... | flask.api.index#flask.Blueprint.url_value_preprocessor |
url_value_preprocessors: t.Dict[AppOrBlueprintKey, t.List[URLValuePreprocessorCallable]]
A data structure of functions to call to modify the keyword arguments passed to the view function, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all request... | flask.api.index#flask.Blueprint.url_value_preprocessors |
view_functions: t.Dict[str, t.Callable]
A dictionary mapping endpoint names to view functions. To register a view function, use the route() decorator. This data structure is internal. It should not be modified directly and its format may change at any time. | flask.api.index#flask.Blueprint.view_functions |
class flask.blueprints.BlueprintSetupState(blueprint, app, options, first_registration)
Temporary holder object for registering a blueprint with the application. An instance of this class is created by the make_setup_state() method and later passed to all register callback functions. Parameters
blueprint (Bluepri... | flask.api.index#flask.blueprints.BlueprintSetupState |
add_url_rule(rule, endpoint=None, view_func=None, **options)
A helper method to register a rule (and optionally a view function) to the application. The endpoint is automatically prefixed with the blueprint’s name. Parameters
rule (str) –
endpoint (Optional[str]) –
view_func (Optional[Callable]) –
options (... | flask.api.index#flask.blueprints.BlueprintSetupState.add_url_rule |
app
a reference to the current application | flask.api.index#flask.blueprints.BlueprintSetupState.app |
blueprint
a reference to the blueprint that created this setup state. | flask.api.index#flask.blueprints.BlueprintSetupState.blueprint |
first_registration
as blueprints can be registered multiple times with the application and not everything wants to be registered multiple times on it, this attribute can be used to figure out if the blueprint was registered in the past already. | flask.api.index#flask.blueprints.BlueprintSetupState.first_registration |
options
a dictionary with all options that were passed to the register_blueprint() method. | flask.api.index#flask.blueprints.BlueprintSetupState.options |
subdomain
The subdomain that the blueprint should be active for, None otherwise. | flask.api.index#flask.blueprints.BlueprintSetupState.subdomain |
url_defaults
A dictionary with URL defaults that is added to each and every URL that was defined with the blueprint. | flask.api.index#flask.blueprints.BlueprintSetupState.url_defaults |
url_prefix
The prefix that should be used for all URLs defined on the blueprint. | flask.api.index#flask.blueprints.BlueprintSetupState.url_prefix |
Caching When your application runs slow, throw some caches in. Well, at least it’s the easiest way to speed up things. What does a cache do? Say you have a function that takes some time to complete but the results would still be good enough if they were 5 minutes old. So then the idea is that you actually put the resul... | flask.patterns.caching.index |
CGI If all other deployment methods do not work, CGI will work for sure. CGI is supported by all major servers but usually has a sub-optimal performance. This is also the way you can use a Flask application on Google’s App Engine, where execution happens in a CGI-like environment. Watch Out Please make sure in advance... | flask.deploying.cgi.index |
Changes Version 2.0.1 Unreleased Re-add the filename parameter in send_from_directory. The filename parameter has been renamed to path, the old name is deprecated. #4019
Version 2.0.0 Released 2021-05-11 Drop support for Python 2 and 3.5. Bump minimum versions of other Pallets projects: Werkzeug >= 2, Jinja2 >= 3, ... | flask.changes.index |
class flask.Config(root_path, defaults=None)
Works exactly like a dict but provides ways to fill it from files or special dictionaries. There are two common patterns to populate the config. Either you can fill the config from a config file: app.config.from_pyfile('yourconfig.cfg')
Or alternatively you can define the... | flask.api.index#flask.Config |
from_envvar(variable_name, silent=False)
Loads a configuration from an environment variable pointing to a configuration file. This is basically just a shortcut with nicer error messages for this line of code: app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
Parameters
variable_name (str) – name of ... | flask.api.index#flask.Config.from_envvar |
from_file(filename, load, silent=False)
Update the values in the config from a file that is loaded using the load parameter. The loaded data is passed to the from_mapping() method. import toml
app.config.from_file("config.toml", load=toml.load)
Parameters
filename (str) – The path to the data file. This can be a... | flask.api.index#flask.Config.from_file |
from_mapping(mapping=None, **kwargs)
Updates the config like update() ignoring items with non-upper keys. Changelog New in version 0.11. Parameters
mapping (Optional[Mapping[str, Any]]) –
kwargs (Any) – Return type
bool | flask.api.index#flask.Config.from_mapping |
from_object(obj)
Updates the values from the given object. An object can be of one of the following two types: a string: in this case the object with that name will be imported an actual object reference: that object is used directly Objects are usually either modules or classes. from_object() loads only the upperc... | flask.api.index#flask.Config.from_object |
from_pyfile(filename, silent=False)
Updates the values in the config from a Python file. This function behaves as if the file was imported as module with the from_object() function. Parameters
filename (str) – the filename of the config. This can either be an absolute filename or a filename relative to the root p... | flask.api.index#flask.Config.from_pyfile |
get_namespace(namespace, lowercase=True, trim_namespace=True)
Returns a dictionary containing a subset of configuration options that match the specified namespace/prefix. Example usage: app.config['IMAGE_STORE_TYPE'] = 'fs'
app.config['IMAGE_STORE_PATH'] = '/var/app/images'
app.config['IMAGE_STORE_BASE_URL'] = 'http:... | flask.api.index#flask.Config.get_namespace |
flask.copy_current_request_context(f)
A helper function that decorates a function to retain the current request context. This is useful when working with greenlets. The moment the function is decorated a copy of the request context is created and then pushed when the function is called. The current session is also in... | flask.api.index#flask.copy_current_request_context |
DEBUG
Whether debug mode is enabled. When using flask run to start the development server, an interactive debugger will be shown for unhandled exceptions, and the server will be reloaded when code changes. The debug attribute maps to this config key. This is enabled when ENV is 'development' and is overridden by the ... | flask.config.index#DEBUG |
flask.json.dump(obj, fp, app=None, **kwargs)
Serialize an object to JSON written to a file object. Takes the same arguments as the built-in json.dump(), with some defaults from application configuration. Parameters
obj (Any) – Object to serialize to JSON.
fp (IO[str]) – File object to write JSON to.
app (Option... | flask.api.index#flask.json.dump |
flask.json.dumps(obj, app=None, **kwargs)
Serialize an object to a string of JSON. Takes the same arguments as the built-in json.dumps(), with some defaults from application configuration. Parameters
obj (Any) – Object to serialize to JSON.
app (Optional[Flask]) – Use this app’s config instead of the active app ... | flask.api.index#flask.json.dumps |
ENV
What environment the app is running in. Flask and extensions may enable behaviors based on the environment, such as enabling debug mode. The env attribute maps to this config key. This is set by the FLASK_ENV environment variable and may not behave as expected if set in code. Do not enable development when deploy... | flask.config.index#ENV |
flask.escape()
Replace the characters &, <, >, ', and " in the string with HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the object has an __html__ method, it is called and the return value is assumed to already be safe for HTML. Parameters
s – An object to... | flask.api.index#flask.escape |
EXPLAIN_TEMPLATE_LOADING
Log debugging information tracing how a template file was loaded. This can be useful to figure out why a template was not loaded or the wrong file appears to be loaded. Default: False | flask.config.index#EXPLAIN_TEMPLATE_LOADING |
Extensions Extensions are extra packages that add functionality to a Flask application. For example, an extension might add support for sending email or connecting to a database. Some extensions add entire new frameworks to help build certain types of applications, like a REST API. Finding Extensions Flask extensions a... | flask.extensions.index |
FastCGI FastCGI is a deployment option on servers like nginx, lighttpd, and cherokee; see uWSGI and Standalone WSGI Containers for other options. To use your WSGI application with any of them you will need a FastCGI server first. The most popular one is flup which we will use for this guide. Make sure to have it instal... | flask.deploying.fastcgi.index |
flask.flash(message, category='message')
Flashes a message to the next request. In order to remove the flashed message from the session and to display it to the user, the template has to call get_flashed_messages(). Changelog Changed in version 0.3: category parameter added. Parameters
message (str) – the messa... | flask.api.index#flask.flash |
class flask.Flask(import_name, static_url_path=None, static_folder='static', static_host=None, host_matching=False, subdomain_matching=False, template_folder='templates', instance_path=None, instance_relative_config=False, root_path=None)
The flask object implements a WSGI application and acts as the central object. ... | flask.api.index#flask.Flask |
add_template_filter(f, name=None)
Register a custom template filter. Works exactly like the template_filter() decorator. Parameters
name (Optional[str]) – the optional name of the filter, otherwise the function name will be used.
f (Callable[[Any], str]) – Return type
None | flask.api.index#flask.Flask.add_template_filter |
add_template_global(f, name=None)
Register a custom template global function. Works exactly like the template_global() decorator. Changelog New in version 0.10. Parameters
name (Optional[str]) – the optional name of the global function, otherwise the function name will be used.
f (Callable[[], Any]) – Retur... | flask.api.index#flask.Flask.add_template_global |
add_template_test(f, name=None)
Register a custom template test. Works exactly like the template_test() decorator. Changelog New in version 0.10. Parameters
name (Optional[str]) – the optional name of the test, otherwise the function name will be used.
f (Callable[[Any], bool]) – Return type
None | flask.api.index#flask.Flask.add_template_test |
add_url_rule(rule, endpoint=None, view_func=None, provide_automatic_options=None, **options)
Register a rule for routing incoming requests and building URLs. The route() decorator is a shortcut to call this with the view_func argument. These are equivalent: @app.route("/")
def index():
...
def index():
...
... | flask.api.index#flask.Flask.add_url_rule |
after_request(f)
Register a function to run after each request to this object. The function is called with the response object, and must return a response object. This allows the functions to modify or replace the response before it is sent. If a function raises an exception, any remaining after_request functions wil... | flask.api.index#flask.Flask.after_request |
after_request_funcs: t.Dict[AppOrBlueprintKey, t.List[AfterRequestCallable]]
A data structure of functions to call at the end of each request, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all requests. To register a function, use the after_requ... | flask.api.index#flask.Flask.after_request_funcs |
flask.appcontext_popped
This signal is sent when an application context is popped. The sender is the application. This usually falls in line with the appcontext_tearing_down signal. Changelog New in version 0.10. | flask.api.index#flask.appcontext_popped |
flask.appcontext_pushed
This signal is sent when an application context is pushed. The sender is the application. This is usually useful for unittests in order to temporarily hook in information. For instance it can be used to set a resource early onto the g object. Example usage: from contextlib import contextmanage... | flask.api.index#flask.appcontext_pushed |
flask.appcontext_tearing_down
This signal is sent when the app context is tearing down. This is always called, even if an exception is caused. Currently functions listening to this signal are called after the regular teardown handlers, but this is not something you can rely on. Example subscriber: def close_db_connec... | flask.api.index#flask.appcontext_tearing_down |
app_context()
Create an AppContext. Use as a with block to push the context, which will make current_app point at this application. An application context is automatically pushed by RequestContext.push() when handling a request, and when running a CLI command. Use this to manually create a context outside of these si... | flask.api.index#flask.Flask.app_context |
app_ctx_globals_class
alias of flask.ctx._AppCtxGlobals | flask.api.index#flask.Flask.app_ctx_globals_class |
async_to_sync(func)
Return a sync function that will run the coroutine function. result = app.async_to_sync(func)(*args, **kwargs)
Override this method to change how the app converts async code to be synchronously callable. New in version 2.0. Parameters
func (Callable[[...], Coroutine]) – Return type
Callabl... | flask.api.index#flask.Flask.async_to_sync |
auto_find_instance_path()
Tries to locate the instance path if it was not provided to the constructor of the application class. It will basically calculate the path to a folder named instance next to your main file or the package. Changelog New in version 0.8. Return type
str | flask.api.index#flask.Flask.auto_find_instance_path |
before_first_request(f)
Registers a function to be run before the first request to this instance of the application. The function will be called without any arguments and its return value is ignored. Changelog New in version 0.8. Parameters
f (Callable[[], None]) – Return type
Callable[[], None] | flask.api.index#flask.Flask.before_first_request |
before_first_request_funcs: t.List[BeforeRequestCallable]
A list of functions that will be called at the beginning of the first request to this instance. To register a function, use the before_first_request() decorator. Changelog New in version 0.8. | flask.api.index#flask.Flask.before_first_request_funcs |
before_request(f)
Register a function to run before each request. For example, this can be used to open a database connection, or to load the logged in user from the session. @app.before_request
def load_user():
if "user_id" in session:
g.user = db.session.get(session["user_id"])
The function will be cal... | flask.api.index#flask.Flask.before_request |
before_request_funcs: t.Dict[AppOrBlueprintKey, t.List[BeforeRequestCallable]]
A data structure of functions to call at the beginning of each request, in the format {scope: [functions]}. The scope key is the name of a blueprint the functions are active for, or None for all requests. To register a function, use the be... | flask.api.index#flask.Flask.before_request_funcs |
blueprints: t.Dict[str, ‘Blueprint’]
Maps registered blueprint names to blueprint objects. The dict retains the order the blueprints were registered in. Blueprints can be registered multiple times, this dict does not track how often they were attached. Changelog New in version 0.7. | flask.api.index#flask.Flask.blueprints |
cli
The Click command group for registering CLI commands for this object. The commands are available from the flask command once the application has been discovered and blueprints have been registered. | flask.api.index#flask.Flask.cli |
flask.cli.run_command = <Command run>
Run a local development server. This server is for development purposes only. It does not provide the stability, security, or performance of production WSGI servers. The reloader and debugger are enabled by default if FLASK_ENV=development or FLASK_DEBUG=1. Parameters
args (A... | flask.api.index#flask.cli.run_command |
flask.cli.shell_command = <Command shell>
Run an interactive Python shell in the context of a given Flask application. The application will populate the default namespace of this shell according to its configuration. This is useful for executing small snippets of management code without having to manually configure t... | flask.api.index#flask.cli.shell_command |
config
The configuration dictionary as Config. This behaves exactly like a regular dictionary but supports additional methods to load a config from files. | flask.api.index#flask.Flask.config |
config_class
alias of flask.config.Config | flask.api.index#flask.Flask.config_class |
context_processor(f)
Registers a template context processor function. Parameters
f (Callable[[], Dict[str, Any]]) – Return type
Callable[[], Dict[str, Any]] | flask.api.index#flask.Flask.context_processor |
create_global_jinja_loader()
Creates the loader for the Jinja2 environment. Can be used to override just the loader and keeping the rest unchanged. It’s discouraged to override this function. Instead one should override the jinja_loader() function instead. The global loader dispatches between the loaders of the appli... | flask.api.index#flask.Flask.create_global_jinja_loader |
create_jinja_environment()
Create the Jinja environment based on jinja_options and the various Jinja-related methods of the app. Changing jinja_options after this will have no effect. Also adds Flask-related globals and filters to the environment. Changelog Changed in version 0.11: Environment.auto_reload set in acc... | flask.api.index#flask.Flask.create_jinja_environment |
create_url_adapter(request)
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. Changelog Changed in version 1.0: SERVER_NAME no longer implicitly enables subdomain matching. Use subdomain_matching instead... | flask.api.index#flask.Flask.create_url_adapter |
flask.current_app
A proxy to the application handling the current request. This is useful to access the application without needing to import it, or if it can’t be imported, such as when using the application factory pattern or in blueprints and extensions. This is only available when an application context is pushed... | flask.api.index#flask.current_app |
default_config = {'APPLICATION_ROOT': '/', 'DEBUG': None, 'ENV': None, 'EXPLAIN_TEMPLATE_LOADING': False, 'JSONIFY_MIMETYPE': 'application/json', 'JSONIFY_PRETTYPRINT_REGULAR': False, 'JSON_AS_ASCII': True, 'JSON_SORT_KEYS': True, 'MAX_CONTENT_LENGTH': None, 'MAX_COOKIE_SIZE': 4093, 'PERMANENT_SESSION_LIFETIME': dateti... | flask.api.index#flask.Flask.default_config |
delete(rule, **options)
Shortcut for route() with methods=["DELETE"]. New in version 2.0. Parameters
rule (str) –
options (Any) – Return type
Callable | flask.api.index#flask.Flask.delete |
dispatch_request()
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 make_response(). Changelog Changed in version 0.7: This no longer does the exc... | flask.api.index#flask.Flask.dispatch_request |
do_teardown_appcontext(exc=<object object>)
Called right before the application context is popped. When handling a request, the application context is popped after the request context. See do_teardown_request(). This calls all functions decorated with teardown_appcontext(). Then the appcontext_tearing_down signal is ... | flask.api.index#flask.Flask.do_teardown_appcontext |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.