Skip to content

Commit 7cc968f

Browse files
committed
Use full path in case the working dir is not the same
1 parent fb3f898 commit 7cc968f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

project/manage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import sys
55

66
import environ
7+
ROOT_DIR = environ.Path(__file__) - 1
78

89
if __name__ == "__main__":
9-
if os.path.isfile('.env'):
10-
environ.Env.read_env('.env')
10+
if os.path.isfile(str(ROOT_DIR + '.env')):
11+
environ.Env.read_env(str(ROOT_DIR + '.env'))
1112
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
1213

1314
from django.core.management import execute_from_command_line

0 commit comments

Comments
 (0)