feat(src/djinit/templates/config/settings): resolve env_path for settings base
Resolve env_path to correctly load .env file from project root.
This commit is contained in:
1 file changed
+2
-1
@@ -9,8 +9,9 @@ from pathlib import Path
|
|||||||
|
|
||||||
import environ
|
import environ
|
||||||
|
|
||||||
|
env_path = Path(__file__).resolve().parent.parent / ".env"
|
||||||
env = environ.Env()
|
env = environ.Env()
|
||||||
environ.Env.read_env()
|
environ.Env.read_env(env_path)
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||||
|
|||||||
Reference in new issue
Block a user