Skip to content

Commit 88ae44b

Browse files
committed
Add documentation
Signed-off-by: Alina Buzachis <[email protected]>
1 parent 4cfa22f commit 88ae44b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Hi there! We're excited to have you as a contributor.
1313
- [Set env variables for development](#set-env-variables-for-development)
1414
- [Configure postgres and run the dispatcher service](#configure-postgres-and-run-the-dispatcher-service)
1515
- [Configure and run the application](#configure-and-run-the-application)
16+
- [Development configuration](#development-configuration)
1617
- [Updating dependencies](#updating-dependencies)
1718
- [Running linters and code checks](#running-linters-and-code-checks)
1819
- [Running tests](#running-tests)
@@ -85,6 +86,50 @@ In a separate terminal window, run:
8586

8687
The application can be reached in your browser at `https://localhost:8000/`. The Django admin UI is accessible at `https://localhost:8000/admin` and the available API endpoints will be listed in the 404 information at `http://localhost:8000/api/pattern-service/v1/`.
8788

89+
### Development Configuration
90+
91+
The application uses dynaconf to manage configuration. Default development settings are defined in `development_defaults.py`. These include:
92+
93+
#### Database
94+
95+
By default, the application uses a local SQLite database:
96+
97+
```bash
98+
# Default DB path
99+
default_path = BASE_DIR / "db.sqlite3"
100+
101+
# Use environment variable if set, else default
102+
env_path = os.getenv("SQLITE_PATH")
103+
db_path = Path(env_path) if env_path else default_path
104+
```
105+
106+
You can override the path by setting the `SQLITE_PATH` environment variable.
107+
108+
#### Ansible Automation Platform (AAP) Service Configuration
109+
110+
Default configuration values for connecting to the AAP service are defined in `development_defaults.py`:
111+
112+
```bash
113+
AAP_URL = "http://localhost:44926" # Base URL of your AAP instance
114+
AAP_VALIDATE_CERTS = False # Whether to verify SSL certificates
115+
AAP_USERNAME = "admin" # Username for AAP authentication
116+
AAP_PASSWORD = "password" # Password for AAP authentication
117+
```
118+
119+
*Note*: These defaults are placeholders for local development only. You must provide proper values for your environment by setting environment variables prefixed with `PATTERN_SERVICE_` or via a `.env` file.
120+
For example:
121+
122+
```bash
123+
export PATTERN_SERVICE_AAP_URL="http://your-ip-address:44926"
124+
export PATTERN_SERVICE_AAP_VALIDATE_CERTS="False"
125+
export PATTERN_SERVICE_AAP_USERNAME="admin"
126+
export PATTERN_SERVICE_AAP_PASSWORD="your-password"
127+
```
128+
129+
This ensures secure and correct operation in your deployment or testing environment.
130+
131+
Dynaconf will prioritize environment variables and values in `.env` over defaults in `development_defaults.py`.
132+
88133
## Updating dependencies
89134
90135
Project dependencies for all environments are specified in the [pyproject.toml file](./pyproject.toml). A requirements.txt file is generated for each environment using pip-compile, to simplify dependency installation with pip.

0 commit comments

Comments
 (0)