Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pallets/flask
/ functions
Functions
1,195 in github.com/pallets/flask
⨍
Functions
1,195
◇
Types & classes
136
↳
Endpoints
183
↓ 2 callers
Method
get_source
( self, environment: BaseEnvironment, template: str )
src/flask/templating.py:60
↓ 2 callers
Function
get_version
(ctx: click.Context, param: click.Parameter, value: t.Any)
src/flask/cli.py:267
↓ 2 callers
Function
has_level_handler
Check if there is a handler in the logging chain that will handle the given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`.
src/flask/logging.py:31
↓ 2 callers
Function
index
()
tests/test_reqctx.py:67
↓ 2 callers
Function
init_db
Clear existing data and create new tables.
examples/tutorial/flaskr/db.py:33
↓ 2 callers
Method
inject_url_defaults
Injects the URL defaults for the given endpoint directly into the values dictionary passed. This is used internally and automatically
src/flask/sansio/app.py:911
↓ 2 callers
Method
is_null_session
Checks if a given object is a null session. Null sessions are not asked to be saved. This checks if the object is an instance of :at
src/flask/sessions.py:176
↓ 2 callers
Method
iter_blueprints
Iterates over all blueprints by the order they were registered. .. versionadded:: 0.11
src/flask/sansio/app.py:597
↓ 2 callers
Function
loads
Deserialize data as JSON. If :data:`~flask.current_app` is available, it will use its :meth:`app.json.loads() <flask.json.provider.JSONProvid
src/flask/json/__init__.py:77
↓ 2 callers
Method
loads
Load data from a JSON string and deserialized any tagged objects.
src/flask/json/tag.py:325
↓ 2 callers
Function
main
()
src/flask/cli.py:1128
↓ 2 callers
Method
match_request
Can be overridden by a subclass to hook into the matching of the request.
src/flask/ctx.py:357
↓ 2 callers
Method
open_session
This is called at the beginning of each request, after pushing the request context, before matching the URL. This must return an obje
src/flask/sessions.py:263
↓ 2 callers
Function
prepare_import
Given a filename this will try to calculate the python path, add it to the search path and return the actual module name that is expected.
src/flask/cli.py:200
↓ 2 callers
Method
record
Registers a function that is called when the blueprint is registered on the application. This function is called with the state as ar
src/flask/sansio/blueprints.py:224
↓ 2 callers
Method
register
Called by :meth:`Flask.register_blueprint` to register all views and callbacks registered on the blueprint with the application. Creat
src/flask/sansio/blueprints.py:273
↓ 2 callers
Method
report_error
(self, e)
tests/test_user_error_handler.py:244
↓ 2 callers
Method
save_session
This is called at the end of each request, after generating a response, before removing the request context. It is skipped if :meth:`i
src/flask/sessions.py:277
↓ 2 callers
Function
send_from_directory
Send a file from within a directory using :func:`send_file`. .. code-block:: python @app.route("/uploads/<path:name>") def downl
src/flask/helpers.py:526
↓ 2 callers
Function
stream_with_context
( generator_or_function: t.Iterator[t.AnyStr], )
src/flask/helpers.py:51
↓ 2 callers
Function
template_string
()
tests/test_blueprints.py:637
↓ 2 callers
Method
update_template_context
Update the template context with some commonly used variables. This injects request, session, config and g into the template context a
src/flask/app.py:506
↓ 1 callers
Method
__init__
( self, app_import_path: str | None = None, create_app: t.Callable[..., Flask] | None
src/flask/cli.py:305
↓ 1 callers
Method
__init__
(self, request: Request, key: str)
src/flask/debughelpers.py:28
↓ 1 callers
Method
_check_setup_finished
(self, f_name: str)
src/flask/sansio/scaffold.py:220
↓ 1 callers
Function
_dump_loader_info
(loader: BaseLoader)
src/flask/debughelpers.py:107
↓ 1 callers
Function
_find_package_path
Find the path that contains the package or module.
src/flask/sansio/scaffold.py:709
↓ 1 callers
Method
_get_source_explained
( self, environment: BaseEnvironment, template: str )
src/flask/templating.py:67
↓ 1 callers
Method
_get_source_fast
( self, environment: BaseEnvironment, template: str )
src/flask/templating.py:91
↓ 1 callers
Function
_get_werkzeug_version
()
src/flask/testing.py:99
↓ 1 callers
Method
_merge_blueprint_funcs
(self, app: App, name: str)
src/flask/sansio/blueprints.py:379
↓ 1 callers
Method
_request_from_builder_args
( self, args: tuple[t.Any, ...], kwargs: dict[str, t.Any] )
src/flask/testing.py:192
↓ 1 callers
Method
_untag_scan
(self, value: t.Any)
src/flask/json/tag.py:309
↓ 1 callers
Function
abort
Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given status code. If :data:`~flask.current_app` is available, it will call its
src/flask/helpers.py:266
↓ 1 callers
Method
add_app_template_global
Register a template global, available in any template rendered by the application. Works like the :meth:`app_template_global` decorator. Equiv
src/flask/sansio/blueprints.py:535
↓ 1 callers
Method
add_template_global
Register a custom template global function. Works exactly like the :meth:`template_global` decorator. .. versionadded:: 0.10
src/flask/sansio/app.py:765
↓ 1 callers
Method
add_url_rule
Register a rule for routing incoming requests and building URLs. The :meth:`route` decorator is a shortcut to call this with the ``vie
src/flask/sansio/scaffold.py:368
↓ 1 callers
Method
app
(self)
tests/test_cli.py:448
↓ 1 callers
Method
async_to_sync
Return a sync function that will run the coroutine function. .. code-block:: python result = app.async_to_sync(func)(*args, **kw
src/flask/app.py:980
↓ 1 callers
Function
attach_enctype_error_multidict
Patch ``request.files.__getitem__`` to raise a descriptive error about ``enctype=multipart/form-data``. :param request: The request to patch.
src/flask/debughelpers.py:81
↓ 1 callers
Method
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
src/flask/sansio/app.py:510
↓ 1 callers
Function
celery_init_app
(app: Flask)
examples/celery/src/task_app/__init__.py:29
↓ 1 callers
Method
check
Check if the given value should be tagged by this tag.
src/flask/json/tag.py:73
↓ 1 callers
Method
command
This works exactly like the method of the same name on a regular :class:`click.Group` but it wraps callbacks in :func:`with_appcontext`
src/flask/cli.py:413
↓ 1 callers
Function
create_app
()
examples/celery/src/task_app/__init__.py:7
↓ 1 callers
Method
create_app
()
tests/test_cli.py:66
↓ 1 callers
Method
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 discoura
src/flask/sansio/app.py:523
↓ 1 callers
Method
create_jinja_environment
(self)
src/flask/sansio/app.py:479
↓ 1 callers
Function
create_logger
Get the Flask app's logger and configure it if needed. The logger name will be the same as :attr:`app.import_name <flask.Flask.name>`. W
src/flask/logging.py:58
↓ 1 callers
Function
create_namespace
(package)
tests/test_instance_config.py:47
↓ 1 callers
Function
decorator
(ctx: click.Context, /, *args: t.Any, **kwargs: t.Any)
src/flask/cli.py:395
↓ 1 callers
Method
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
src/flask/app.py:879
↓ 1 callers
Method
do_teardown_appcontext
Called right before the application context is popped. When handling a request, the application context is popped after the request c
src/flask/app.py:1360
↓ 1 callers
Method
do_teardown_request
Called after the request is dispatched and the response is returned, right before the request context is popped. This calls all funct
src/flask/app.py:1326
↓ 1 callers
Function
dotenv_not_available
()
tests/test_cli.py:521
↓ 1 callers
Function
dumps
Serialize data as JSON. If :data:`~flask.current_app` is available, it will use its :meth:`app.json.dumps() <flask.json.provider.JSONProvider
src/flask/json/__init__.py:13
↓ 1 callers
Method
dumps
Serialize data as JSON to a string. Keyword arguments are passed to :func:`json.dumps`. Sets some parameter defaults from the :attr:`
src/flask/json/provider.py:166
↓ 1 callers
Method
errorhandler
Register a function to handle errors by code or exception class. A decorator that is used to register a function given an error code.
src/flask/sansio/scaffold.py:598
↓ 1 callers
Method
exit
(self)
tests/test_cli.py:236
↓ 1 callers
Function
expect
(path, header_value="Cookie")
tests/test_basic.py:554
↓ 1 callers
Function
expect_exception
(f, *args, **kwargs)
tests/test_basic.py:364
↓ 1 callers
Function
explain_template_loading_attempts
This should help developers understand what failed
src/flask/debughelpers.py:124
↓ 1 callers
Function
find_app_by_string
Check if the given string is a variable name or a function. Call a function to get the app instance, or return the variable directly.
src/flask/cli.py:120
↓ 1 callers
Function
find_package
Find the prefix that a package is installed under, and the path that it would be imported from. The prefix is the directory containing the st
src/flask/sansio/scaffold.py:754
↓ 1 callers
Method
generate
()
tests/test_helpers.py:240
↓ 1 callers
Function
generator
()
src/flask/helpers.py:108
↓ 1 callers
Method
get_cookie_domain
The value of the ``Domain`` parameter on the session cookie. If not set, browsers will only send the cookie to the exact domain it was set fro
src/flask/sessions.py:189
↓ 1 callers
Method
get_cookie_httponly
Returns True if the session cookie should be httponly. This currently just returns the value of the ``SESSION_COOKIE_HTTPONLY`` confi
src/flask/sessions.py:209
↓ 1 callers
Method
get_cookie_partitioned
Returns True if the cookie should be partitioned. By default, uses the value of :data:`SESSION_COOKIE_PARTITIONED`. .. versionadded::
src/flask/sessions.py:229
↓ 1 callers
Method
get_cookie_path
Returns the path for which the cookie should be valid. The default implementation uses the value from the ``SESSION_COOKIE_PATH`` con
src/flask/sessions.py:201
↓ 1 callers
Method
get_cookie_samesite
Return ``'Strict'`` or ``'Lax'`` if the cookie should use the ``SameSite`` attribute. This currently just returns the value of the :da
src/flask/sessions.py:222
↓ 1 callers
Method
get_cookie_secure
Returns True if the cookie should be secure. This currently just returns the value of the ``SESSION_COOKIE_SECURE`` setting.
src/flask/sessions.py:216
↓ 1 callers
Method
get_expiration_time
A helper method that returns an expiration date for the session or ``None`` if the session is linked to the browser session. The defa
src/flask/sessions.py:237
↓ 1 callers
Method
get_namespace
Returns a dictionary containing a subset of configuration options that match the specified namespace/prefix. Example usage:: app.
src/flask/config.py:323
↓ 1 callers
Function
get_root_path
Find the root path of a package, or the path that contains a module. If it cannot be found, returns the current working directory. Not to
src/flask/helpers.py:570
↓ 1 callers
Method
get_send_file_max_age
Used by :func:`send_file` to determine the ``max_age`` cache value for a given file path if it wasn't passed. By default, this return
src/flask/app.py:281
↓ 1 callers
Method
get_send_file_max_age
Used by :func:`send_file` to determine the ``max_age`` cache value for a given file path if it wasn't passed. By default, this return
src/flask/blueprints.py:55
↓ 1 callers
Method
group
This works exactly like the method of the same name on a regular :class:`click.Group` but it defaults the group class to :class:`AppGr
src/flask/cli.py:429
↓ 1 callers
Method
handle_exception
Handle an exception that did not have an error handler associated with it, or that was raised from an error handler. This always cause
src/flask/app.py:811
↓ 1 callers
Method
handle_http_exception
Handles an HTTP exception. By default this will invoke the registered error handlers and fall back to returning the exception as resp
src/flask/app.py:744
↓ 1 callers
Method
handle_url_build_error
Called by :meth:`.url_for` if a :exc:`~werkzeug.routing.BuildError` was raised. If this returns a value, it will be returned by ``url_
src/flask/sansio/app.py:932
↓ 1 callers
Method
handle_user_exception
This method is called whenever an exception occurs that should be handled. A special case is :class:`~werkzeug .exceptions.HTTPExcepti
src/flask/app.py:779
↓ 1 callers
Function
handler
(error, endpoint, values)
tests/test_basic.py:1361
↓ 1 callers
Method
index
(self, test="a")
tests/test_basic.py:1835
↓ 1 callers
Method
invoke
Invokes a CLI command in an isolated environment. See :meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for full method docume
src/flask/testing.py:274
↓ 1 callers
Method
list_templates
(self)
src/flask/templating.py:111
↓ 1 callers
Function
load
Deserialize data as JSON read from a file. If :data:`~flask.current_app` is available, it will use its :meth:`app.json.load() <flask.json.pro
src/flask/json/__init__.py:108
↓ 1 callers
Method
log_exception
Logs an exception. This is called by :meth:`handle_exception` if debugging is disabled and right before the handler is called. The de
src/flask/app.py:864
↓ 1 callers
Method
logout
(self)
examples/tutorial/tests/conftest.py:56
↓ 1 callers
Method
make_aborter
Create the object to assign to :attr:`aborter`. That object is called by :func:`flask.abort` to raise HTTP errors, and can be called d
src/flask/sansio/app.py:498
↓ 1 callers
Method
make_config
Used to create the config attribute by the Flask constructor. The `instance_relative` parameter is passed in from the constructor of F
src/flask/sansio/app.py:482
↓ 1 callers
Method
make_default_options_response
This method is called to create the default ``OPTIONS`` response. This can be changed through subclassing to change the default behavi
src/flask/app.py:953
↓ 1 callers
Method
make_null_session
Creates a null session which acts as a replacement object if the real session support could not be loaded due to a configuration error
src/flask/sessions.py:164
↓ 1 callers
Method
make_setup_state
Creates an instance of :meth:`~flask.blueprints.BlueprintSetupState` object that is later passed to the register callback functions. S
src/flask/sansio/blueprints.py:246
↓ 1 callers
Method
make_shell_context
Returns the shell context for an interactive shell for this application. This runs all the registered shell context processors.
src/flask/app.py:534
↓ 1 callers
Function
meh
()
tests/test_reqctx.py:113
↓ 1 callers
Method
pop
Pops the request context and unbinds it by doing that. This will also trigger the execution of functions registered by the :meth:`~fl
src/flask/ctx.py:396
↓ 1 callers
Method
post
(self)
tests/test_async.py:35
↓ 1 callers
Method
preprocess_request
Called before the request is dispatched. Calls :attr:`url_value_preprocessors` registered with the app and the current blueprint (if a
src/flask/app.py:1271
↓ 1 callers
Method
process_response
Can 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
src/flask/app.py:1298
← previous
next →
101–200 of 1,195, ranked by callers