> ## 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 Python-configuratie

Deze documentatie legt uit hoe u AppSignal configureert. Voor meer informatie over het installeren van AppSignal, volgt u de stappen in onze [installatiedocumentatie](/python/installation/).

### Applicatieomgeving

Standaard rapporteert de AppSignal voor Python-integratie de huidige applicatie in de "development"-omgeving. U kunt de `environment`-configuratie-optie gebruiken om een andere omgeving in te stellen. Bijvoorbeeld, in uw `__appsignal__.py`-bestand:

<CodeGroup>
  ```python Python theme={null}
  # __appsignal__.py
  appsignal = Appsignal(
      # ...
      environment="production"
  )
  ```
</CodeGroup>

U kunt ook de `APPSIGNAL_APP_ENV` environment variable gebruiken.

### Deploys rapporteren

U kunt [Deploy Markers](/application/markers/deploy-markers) gebruiken om nieuwe deploys van uw Python-applicatie te rapporteren. U kunt Deploy Markers combineren met [Backtrace Links](/application/backtrace-links) om direct vanuit AppSignal naar de broncode op platforms zoals GitHub en GitLab te linken.

Deploy markers kunnen worden geconfigureerd met behulp van de `revision`-configuratieoptie of de `APP_REVISION` environment variable. We raden aan om Git commit SHA's of een tag in uw SCM te gebruiken. Voor Git-applicaties voegt u bijvoorbeeld de volgende code toe aan het `__appsignal__.py`-bestand:

<CodeGroup>
  ```python Python theme={null}
  # __appsignal__.py
  import subprocess

  revision = None

  try:
      revision = subprocess.check_output(
          "git rev-parse --short HEAD", shell=True, text=True
      ).strip()
  except subprocess.CalledProcessError:
    pass

  appsignal = Appsignal(
      # ...
      revision=revision
  )
  ```
</CodeGroup>

## Het configuratiebestand importeren

De AppSignal voor Python-integratie moet worden geladen en gestart in uw applicatie. Om de integratie te laden en starten, importeert u de `appsignal`-module en roept u de `appsignal.start()`-methode aan bij het starten van de app of in de `main`-methode.

<Tip>
  AppSignal ondersteunt ook populaire webframeworks rechtstreeks, zoals
  [Django](/python/instrumentations/django),
  [Flask](/python/instrumentations/flask),
  [FastAPI](/python/instrumentations/fastapi) of
  [Starlette](/python/instrumentations/starlette). Als u een
  webframework gebruikt dat we rechtstreeks ondersteunen, volgt u de instructies voor dat framework
  in plaats van de generieke instructies op deze pagina.
</Tip>

<CodeGroup>
  ```python Python theme={null}
  # Your app file

  # Add this import statement
  import appsignal

  def main():
      # Add this method call
      appsignal.start()


  if __name__ == '__main__':
      main()
  ```
</CodeGroup>

## Instrumentatiepakketten toevoegen

De volgende stap is het instrumenteren van Python-bibliotheken zoals Django, Celery, enz. Het instrumenteren van bibliotheken biedt een bredere set aan monitoringgegevens, waardoor u de prestaties van uw applicatie beter kunt begrijpen.

Lees meer over het installeren en configureren van instrumentaties in onze [Python-instrumentatiedocumentatie][instrumentations].

[Python language]: https://www.python.org/

[OpenTelemetry]: https://opentelemetry.io/

[instrumentations]: /python/instrumentations

[django]: /python/instrumentations/django.html
