> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal for Python load order

This documentation outlines how the AppSignal configuration is loaded in your Python application.

There are two different methods for [configuring your AppSignal integration](/python/configuration), which can be used simultaneously:

* Config file (`__appsignal__.py`)
* Environment variables

A list of available options can be found in the [Configuration options](/python/configuration/options) documentation.

## Load order

The configuration is loaded in a four-step process:

1. [Package defaults - `default`](#1-package-defaults)
2. [System detected settings - `system`](#2-system-detected-settings)
3. [Environment variables - `env`](#3-environment-variables)
4. [Initial configuration - `initial`](#4-initial-configuration-given-to-appsignal)

## 1. Package defaults

First, the default configuration is loaded, which sets paths and enables certain features.

This source will be listed under `default` in your application's config and is visible in the [Diagnose report](https://docs.appsignal.com/support/debugging.html).

## 2. System detected settings

The package detects what kind of system it's running on and configures itself accordingly.

For example, if running inside a container-based system such as Docker or Heroku, the configuration option `running_in_container` is set to `true`.

This source will be listed under `system` in your application's config and is visible in the [Diagnose report](https://docs.appsignal.com/support/debugging.html).

## 3. Environment variables

AppSignal will look for Configuration options set via Environment variables. The Environment variable value will override values for the same Configuration options defined in previous steps.

<CodeGroup>
  ```bash Bash theme={null}
  export APPSIGNAL_APP_NAME="my custom app name"
  # start your app here
  ```
</CodeGroup>

This source will be listed under `env` in your application's configuration, and is visible in the [Diagnose report](https://docs.appsignal.com/support/debugging.html).

## 4. Initial configuration given to `Appsignal`

Finally, the initial configuration is loaded via the `Appsignal` function called from the `__appsignal__.py` config file:

<CodeGroup>
  ```ruby Ruby theme={null}
  # __appsignal__.py
  appsignal = Appsignal(
      active=True,
      name="My app name",
      push_api_key="00000000-0000-0000-0000-000000000000"
  )
  ```
</CodeGroup>

The values of Conig options defined in this step will override values for the same Configuration options defined in previous steps.

This source will be listed under `initial` in your application's config and is visible in the [Diagnose report](https://docs.appsignal.com/support/debugging.html).
