Skip to content

Commit

Permalink
fix: Modify config.py to support pip installed apps
Browse files Browse the repository at this point in the history
This commit modifies the `config.py` file in the `gull_api` module to support applications installed via pip:

- Replaces the default `load_dotenv()` call with specifying a path to the `.env` file in the current working directory.
- This enables environment variable loading for applications installed through pip which may not have the `.env` file in the module's directory.

This fix ensures that configuration handling is compatible with both local and pip installed instances of the application.
  • Loading branch information
mdbecker committed Jun 27, 2023
1 parent 858fd20 commit b5aa185
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gull_api/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv()
# Path to the .env file in the current working directory
env_path = os.path.join(os.getcwd(), '.env')

# Load environment variables from the specific .env file
load_dotenv(dotenv_path=env_path)

# Define configuration variables
CLI_JSON_PATH = os.getenv("CLI_JSON_PATH", "cli.json")
Expand Down

0 comments on commit b5aa185

Please sign in to comment.