# Having db connection string as a secret - e.g. in dotenv file

**URL:** https://support.prodi.gy/t/having-db-connection-string-as-a-secret-e-g-in-dotenv-file/5975
**Category:** Uncategorized
**Created:** [September 25, 2022, 7:37pm UTC](https://support.prodi.gy/t/having-db-connection-string-as-a-secret-e-g-in-dotenv-file/5975 "2022-09-25T19:37:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nix411](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nix411/32/2982_2.png) [@nix411](https://support.prodi.gy/u/nix411)
#### Post date: [September 25, 2022, 7:37pm UTC](https://support.prodi.gy/t/having-db-connection-string-as-a-secret-e-g-in-dotenv-file/5975/1 "2022-09-25T19:37:45Z")

</div>

Is it possible to keep the connection string in .env file? Or are there other good practices to keep the connection string out of `prodigy.json`?

---

<div class="post-metadata">

### Author: ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)
#### Post date: [September 26, 2022, 9:43am UTC](https://support.prodi.gy/t/having-db-connection-string-as-a-secret-e-g-in-dotenv-file/5975/2 "2022-09-26T09:43:53Z")

</div>

One option might be to use [environment variable overrides](https://prodi.gy/docs/install/#config-overrides). You could source a `.env` file that also contains `export` commands such that it loads a `PRODIGY_CONFIG_OVERRIDES` variable with settings.

For example, suppose that this is your `.env` file:

```python
export PRODIGY_CONFIG_OVERRIDES='{"theme": "spacy"}'

```

Then you can source it.

```python
source .env

```

You can then confirm the environment variable has been set.

```python
> echo $PRODIGY_CONFIG_OVERRIDES
{"theme": "spacy"}

```

And when I now load a demo Prodigy app, you can confirm that the theme has updated.

```python
python -m prodigy textcat.manual issue-5975 examples.jsonl --label pos,neg

```

 ![CleanShot 2022-09-26 at 11.42.38](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/1/113488c3092b29c1d6a86d998d8b74cd81625dcc.png)

You should be able to repeat the steps but with your database settings in the `PRODIGY_CONFIG_OVERRIDES` environment variable.
