App configuration

class, static_path=None, static_url_path=None, static_folder='static', template_folder='templates', instance_path=None, instance_relative_config=False, root_path=None)[source]

Flask with a sandboxed Jinja2 environment, for when your app’s templates need sandboxing. Useful when your app works with externally provided templates:

from import SandboxedFlask
app = SandboxedFlask(__name__)

Creates the Jinja2 environment based on jinja_options and select_jinja_autoescape(). Since 0.7 this also adds the Jinja2 globals and filters after initialization. Override this function to customize the behavior., env=None)[source]

Configure an app depending on the environment. Loads settings from a file named in the instance folder, followed by additional settings from one of, or Typical usage:

from flask import Flask

app = Flask(__name__, instance_relative_config=True)  # Guess environment automatically

init_app() also configures logging by calling coaster.logger.init_app().

  • app – App to be configured
  • env – Environment to configure for ('development', 'production' or 'testing'). If not specified, the FLASK_ENV environment variable is consulted. Defaults to 'development'.