---
title: "Environments"
description: "Learn how to configure your SDK to tell Sentry about your environments."
url: https://docs.sentry.io/platforms/python/configuration/environments/
---

# Environments | Sentry for Python

Environments tell you where an error occurred, whether that's in your production system, your staging server, or elsewhere.

Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes, can't be the string "None", or exceed 64 characters. You can't delete environments, but you can [hide](https://docs.sentry.io/product/sentry-basics/environments.md#hidden-environments) them.

```python
import sentry_sdk

sentry_sdk.init(
    # ...
    environment="staging",
)
```

If you do not set `environment` in `init()`, the Sentry SDK will check for the environment variable, `SENTRY_ENVIRONMENT`. If this is not set, `environment` will default to `production`.

Environments help you better filter issues, releases, and user feedback in the Issue Details page of sentry.io, which you learn more about in our [documentation that covers using environments](https://docs.sentry.io/product/sentry-basics/environments.md).
