Skip to content

Commit c70b1be

Browse files
[docs] add code example for using DAGSTER_IS_DEV_CLI (#29114)
## Summary & Motivation Just added a basic code snippet example of using `DAGSTER_IS_DEV_CLI` env var ## How I Tested These Changes 👀
1 parent 57b39ff commit c70b1be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: docs/docs/guides/deploy/deployment-options/running-dagster-locally.md

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ You may want to detect whether you're running locally. For example, you might wa
8585

8686
`dagster dev` sets the environment variable `DAGSTER_IS_DEV_CLI` to `1`. You can detect whether you're in a local dev environment by checking for the presence of that environment variable.
8787

88+
```python
89+
import os
90+
91+
if os.getenv("DAGSTER_IS_DEV_CLI"):
92+
print("Running in local dev environment")
93+
```
94+
8895
## Moving to production
8996

9097
`dagster dev` is primarily useful for running Dagster for local development and testing. It isn't suitable for the demands of most production deployments. Most importantly, `dagster dev` does not include authentication or web security. Additionally, in a production deployment, you might want to run multiple webserver replicas, have zero downtime continuous deployment of your code, or set up your Dagster daemon to automatically restart if it crashes.

0 commit comments

Comments
 (0)