Local development is done in Docker.
cp .env.example .env
.env
hold sensitive values. Please ask on the ds-etna-dev
slack channel to get those values.
docker compose up -d
During the first time install, your app/static/assets
directory will be empty.
As you mount the project directory to the /app
volume, the static assets from TNA Frontend installed inside the container will be "overwritten" by your empty directory.
To add back in the static assets, run:
docker compose exec app cp -r /app/node_modules/@nationalarchives/frontend/nationalarchives/assets /app/app/static
docker compose exec dev poetry run python manage.py test
docker compose exec dev format
In addition to the base Docker image variables, this application has support for:
Variable | Purpose | Default |
---|---|---|
DJANGO_SETTINGS_MODULE |
The configuration to use | config.settings.production |
DEBUG |
If true, allow debugging | False |
COOKIE_DOMAIN |
The domain to save cookie preferences against | none |
DATABASE_NAME |
The name of the Postgres database | none |
DATABASE_USER |
The username needed to access the Postgres database | none |
DATABASE_PASSWORD |
The password needed to access the Postgres database | none |
DATABASE_HOST |
The Postgres database host | none |
DATABASE_PORT |
The Postgres database port | 5432 |
CSP_IMG_SRC |
A comma separated list of CSP rules for img-src |
'self' |
CSP_SCRIPT_SRC |
A comma separated list of CSP rules for script-src |
'self' |
CSP_SCRIPT_SRC_ELEM |
A comma separated list of CSP rules for script-src-elem |
'self' |
CSP_STYLE_SRC |
A comma separated list of CSP rules for style-src |
'self' |
CSP_STYLE_SRC_ELEM |
A comma separated list of CSP rules for style-src-elem |
'self' |
CSP_FONT_SRC |
A comma separated list of CSP rules for font-src |
'self' |
CSP_CONNECT_SRC |
A comma separated list of CSP rules for connect-src |
'self' |
CSP_MEDIA_SRC |
A comma separated list of CSP rules for media-src |
'self' |
CSP_WORKER_SRC |
A comma separated list of CSP rules for worker-src |
'self' |
CSP_FRAME_SRC |
A comma separated list of CSP rules for frame-src |
'self' |
GA4_ID |
The Google Analytics 4 ID | none |
ROSETTA_API_VERIFY_CERTIFICATES |
Verify certificate for API | True |
.env
variables:
Variable | Purpose |
---|---|
ROSETTA_CLIENT_BASE_URL |
Api used to query the data |
ROSETTA_CLIENT_KEY |
Api key to query the data |