> For the complete documentation index, see [llms.txt](https://docs.shipwithdjango.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shipwithdjango.com/secret-management/order-of-retrieval.md).

# Order of retrieval

The secrets manager in ShipWithDjango follows a specific order when retrieving secrets:

1. **Cache**: First, it checks its cache to see if the secret has already been retrieved during the current session.
2. **Environment File**: Next, it looks in the `.env` file. If the secret is found there, it returns that value.
3. **External Provider**: If the secret is not found in the cache or the `.env` file, the manager will then query the configured external secret management service (Infisical, AWS, or Azure).

This layered approach allows you to easily override secrets for local development or testing by simply adding them to your `.env` file, while still benefiting from the security of an external provider in other environments.
