forked from Fediversity/Fediversity
revert change on USER_SETTINGS_FILE, fixing dev shell
This commit is contained in:
parent
afbbcbc22d
commit
e3b816d85e
1 changed files with 9 additions and 8 deletions
|
@ -176,14 +176,15 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
# TODO(@fricklerhandwerk):
|
# TODO(@fricklerhandwerk):
|
||||||
# we may want to do this with a flat environment instead, and get all values from `os.environ.get()`.
|
# we may want to do this with a flat environment instead, and get all values from `os.environ.get()`.
|
||||||
# this would make it more obvious which moving parts there are, if that environment is specified for development/staging/production in a visible place.
|
# this would make it more obvious which moving parts there are, if that environment is specified for development/staging/production in a visible place.
|
||||||
user_settings_file = env["USER_SETTINGS_FILE"]
|
user_settings_file = env.get("USER_SETTINGS_FILE", None)
|
||||||
spec = importlib.util.spec_from_file_location("user_settings", user_settings_file)
|
if user_settings_file is not None:
|
||||||
if spec is None or spec.loader is None:
|
spec = importlib.util.spec_from_file_location("user_settings", user_settings_file)
|
||||||
raise RuntimeError("User settings specification failed!")
|
if spec is None or spec.loader is None:
|
||||||
module = importlib.util.module_from_spec(spec)
|
raise RuntimeError("User settings specification failed!")
|
||||||
spec.loader.exec_module(module)
|
module = importlib.util.module_from_spec(spec)
|
||||||
sys.modules["user_settings"] = module
|
spec.loader.exec_module(module)
|
||||||
from user_settings import * # noqa: F403 # pyright: ignore [reportMissingImports]
|
sys.modules["user_settings"] = module
|
||||||
|
from user_settings import * # noqa: F403 # pyright: ignore [reportMissingImports]
|
||||||
|
|
||||||
# non-Django application settings
|
# non-Django application settings
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue