質問編集履歴
2
python-dotenvならやりたいことが実現できる旨を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -62,4 +62,34 @@
|
|
62
62
|
|
63
63
|
|
64
64
|
|
65
|
-
(既に構築されていたアプリケーションがOSの環境変数を使っている模様...しかも、それがどのアプリケーションの環境変数なのかわからない.....
|
65
|
+
(既に構築されていたアプリケーションがOSの環境変数を使っている模様...しかも、それがどのアプリケーションの環境変数なのかわからない.....
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
# 追記(2021/07/24)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
こちらの記事に、`python-dotenv`であれば、OSの環境変数を上書きできるとの情報が載っていました。
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
https://maku77.github.io/python/env/dotenv.html
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
以下のようにして実施できるようです。
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
> ```
|
86
|
+
|
87
|
+
> from dotenv import load_dotenv
|
88
|
+
|
89
|
+
> load_dotenv(override=True)
|
90
|
+
|
91
|
+
> ```
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
これと同じことを、`django-environ`で行いたいだけなので、おそらく何かしら方法はあるはず(ちょっと時間がないのでここまでの記載にとどめておきますが、後で調べる予定です)
|
1
URLをリンク化
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
https://django-environ.readthedocs.io/en/latest/index.html?highlight=read_env#environ.environ.Env.read_env
|
41
|
+
[https://django-environ.readthedocs.io/en/latest/index.html?highlight=read_env#environ.environ.Env.read_env](https://django-environ.readthedocs.io/en/latest/index.html?highlight=read_env#environ.environ.Env.read_env)
|
42
42
|
|
43
43
|
|
44
44
|
|