Configuration in Python


You can adjust Sqreen settings according to your needs. This section lists the possible configuration options you have with the Sqreen Python agent.

Configuration methods and precedence

The Sqreen agent reads its configuration from different places. This is the order of precedence:

  • Environment variables
  • A sqreen.ini file
  • Default configuration options

The sqreen.ini file can be in:

  • Your application top level directory
  • In a custom location set by SQREEN_CONFIG_FILE environment variable:
export SQREEN_CONFIG_FILE=/custom/path/sqreen.ini

Deploying Sqreen configuration

Deploy the configuration file on the servers running Sqreen

Configuration variables

Find your organization token by going to Account Settings > Tokens in your Sqreen dashboard, or (https://my.sqreen.com/profile/organization/tokens). Your token has the prefix org_.

To help Sqreen identify the application when you use an organization token, you also need to set a unique application name.

You can provide this information using the SQREEN_TOKEN and SQREEN_APP_NAME environment variables.

When using the application token, only the SQREEN_TOKEN is required.

Application tokens deprecated

Application tokens are unique to an application. Organization tokens are available throughout the organization your account belongs to.

While Sqreen will continue to support application tokens for backward compatibility in the short term, they are now deprecated, and we encourage you to convert your applications to use organization tokens as soon as possible.

Follow this how-to to migrate applications using an application token.

Env variable name Role INI key name Default value
SQREEN_TOKEN The Sqreen token. This identifies the agent to Sqreen backend servers token Empty
SQREEN_APP_NAME The application name as displayed within the Sqreen dashboard app_name Empty
SQREEN_CONFIG_FILE Custom location for the .ini based config Empty
SQREEN_DISABLE Disable the Sqreen agent initialization. disable Empty
SQREEN_LOG_LOCATION Specify a custom file to write Sqreen logs log_location Empty
SQREEN_LOG_LEVEL Sqreen logging level log_level CRITICAL
SQREEN_HTTP_PROXY HTTP proxy server http_proxy Empty
SQREEN_IP_HEADER HTTP header used to determine the client IP address (e.g. X-Forwarded-For) ip_header Empty
SQREEN_STRIP_SENSITIVE_DATA Remove sensitive data before sending them to Sqreen strip_sensitive_data 1