Changeset View
Standalone View
swh/web/settings/common.py
# Copyright (C) 2017-2020 The Software Heritage developers | # Copyright (C) 2017-2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
""" | """ | ||||
Django common settings for swh-web. | Django common settings for swh-web. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | TEMPLATES = [ | ||||
}, | }, | ||||
}, | }, | ||||
] | ] | ||||
DATABASES = { | DATABASES = { | ||||
"default": { | "default": { | ||||
"ENGINE": "django.db.backends.sqlite3", | "ENGINE": "django.db.backends.sqlite3", | ||||
"NAME": swh_web_config["development_db"], | "NAME": swh_web_config.get("development_db", ""), | ||||
anlambert: There is already a default value for `development_db` in `config.py`, not sure that change is… | |||||
ardumontAuthorUnsubmitted Done Inline Actionsnot sure either. ardumont: not sure either.
I had issues and i tried that, i''ll double check. | |||||
ardumontAuthorUnsubmitted Done Inline ActionsWell, we have a keyError if we do not repeat the development_db key... swh-web_1 | "NAME": swh_web_config["development"] swh-web_1 | KeyError: 'development' With the current state of D5391 (which drops that key which has nothing to do with ardumont: Well, we have a keyError if we do not repeat the development_db key...
```
swh-web_1… | |||||
ardumontAuthorUnsubmitted Done Inline Actions"repeat the development key"... So for me that change is more a cleanup... ardumont: "repeat the development key"...
I mean if we do not set that development_db key in the config. | |||||
anlambertUnsubmitted Not Done Inline ActionsYes, got it. Locally I do not have that error when I remove the development_db from my config file anlambert: Yes, got it.
Locally I do not have that error when I remove the `development_db` from my… | |||||
anlambertUnsubmitted Not Done Inline ActionsI did not test in docker though. anlambert: I did not test in docker though. | |||||
ardumontAuthorUnsubmitted Done Inline Actionswith the current docker without the other diff would pass as they set both the dev and prod key. ardumont: with the current docker without the other diff would pass as they set both the dev and prod key. | |||||
anlambertUnsubmitted Not Done Inline ActionsNope, just tested in docker (without your diff applied) and it works as expected if you remove the development_db from the swh-web config file. I have the impression D5391 misses some env files, might be related. anlambert: Nope, just tested in docker (without your diff applied) and it works as expected if you remove… | |||||
ardumontAuthorUnsubmitted Done Inline Actions
Something does not compute for me here. I must have misunderstood something. If the dev key is not present, is the config spec you are referring to below supposed to
If env variables are missing [1], I do not think that will relate to the issue of that [1] which I doubt, swh-web container refused to start up until all were rightfully set ardumont: > Nope, just tested in docker (without your diff applied) and it works as expected if
> you… | |||||
anlambertUnsubmitted Not Done Inline ActionsYes, there is default value hardcoded in config.py that will be picked if not provided in the config file. anlambert: Yes, there is default value hardcoded in `config.py` that will be picked if not provided in the… | |||||
} | } | ||||
} | } | ||||
# Password validation | # Password validation | ||||
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators | ||||
AUTH_PASSWORD_VALIDATORS = [ | AUTH_PASSWORD_VALIDATORS = [ | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |
There is already a default value for development_db in config.py, not sure that change is needed.