Configuration in Python


Sqreen settings can be adjusted 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 located 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

Configuration file should be deployed 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 is prefixed with org_.

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

Those information can be provided using the SQREEN_TOKEN and SQREEN_APP_NAME environment variables. When using the application token, only the SQREEN_TOKEN is required.

Application tokens depreciated

Appplication tokens are dedicated to an application, and 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 depreciated, and we encourage you to convert your applications to use organization tokens as soon as possible.

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