Skip to content

Commit

Permalink
adjust config
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed May 13, 2024
1 parent 694a4be commit 1c13acf
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,24 @@ A custom Django field that integrates with the 1Password `op` CLI to securely ac
python -m pip install django-opfield
```

2. Install the [1Password `op` CLI tool](https://developer.1password.com/docs/cli/get-started), making sure it is callable from where your application is running.
2. Install the [1Password `op` CLI tool](https://developer.1password.com/docs/cli/get-started), making sure it is callable from wherever your application is running.

3. Create a [1Password service account](https://developer.1password.com/docs/service-accounts/get-started).
3. Create a [1Password service account](https://developer.1password.com/docs/service-accounts/get-started) and make the service account's token available to your application.

To make the service account's token available to `django-opfield`, either set the `OP_SERVICE_ACCOUNT_TOKEN` environment variable or set it in your application's `settings.py`:
Choose one option:

```python
# settings.py
DJANGO_OPFIELD = {
# Explicitly set here only as an example
# Use whatever configuration/environment library you prefer
# (`python-dotenv`, `django-environs`, `environs`, etc.)
"OP_SERVICE_ACCOUNT_TOKEN": "super-secret-token",
}
```
- Set the `OP_SERVICE_ACCOUNT_TOKEN` environment variable
- Configure in your application's `settings.py`:

```python
# settings.py
DJANGO_OPFIELD = {
# Explicitly set here only as an example
# Use whatever configuration/environment library you prefer
# (`python-dotenv`, `django-environs`, `environs`, etc.)
"OP_SERVICE_ACCOUNT_TOKEN": "super-secret-token",
}
```

## Usage

Expand Down

0 comments on commit 1c13acf

Please sign in to comment.