flask.ctx has_app_context Example Code

has_app_context is a function in the flask.ctx module that is similar to has_request_context but for the application context rather than the request.

after_this_request and has_request_context are a couple of other callables within the flask.ctx package that also have code examples.

Example 1 from flask-restx

Flask RESTX is an extension that makes it easier to build RESTful APIs into your applications. Flask RESTX aims for minimal configuration to get basic APIs running for existing applications and it exposes endpoint documentation using Swagger.

Flask RESTX is provided as open source under the BSD 3-Clause license.

flask-restx / flask_restx / marshalling.py

Example 2 from indico

indico (project website, documentation and sandbox demo) is a Flask-based web app for event management. The code is open sourced under the MIT license.

indico / indico / util / i18n.py