xspinners commited on
Commit
59f0cd2
·
1 Parent(s): 5dcb38c
Files changed (2) hide show
  1. devlab_next/settings.py +24 -8
  2. manage.py +0 -1
devlab_next/settings.py CHANGED
@@ -12,7 +12,12 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
12
 
13
  from pathlib import Path
14
  import os
15
- os.environ["DEEPFACE_HOME"] = "./deepface_home"
 
 
 
 
 
16
 
17
 
18
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
@@ -87,14 +92,25 @@ WSGI_APPLICATION = 'devlab_next.wsgi.application'
87
  # }
88
  # }
89
 
 
 
 
 
 
 
 
 
 
 
 
90
  DATABASES = {
91
- "default": {
92
- "ENGINE": "django.db.backends.postgresql",
93
- "NAME": os.environ.get("DB_NAME", "factcheckapidb"),
94
- "USER": os.environ.get("DB_USER", "postgres"),
95
- "PASSWORD": os.environ.get("DB_PASSWORD", "postgres"),
96
- "HOST": os.environ.get("DB_HOST", "127.0.0.1"),
97
- "PORT": os.environ.get("DB_PORT", "5432"),
98
  }
99
  }
100
 
 
12
 
13
  from pathlib import Path
14
  import os
15
+
16
+ deepface_home = "./deepface_home"
17
+ os.environ["DEEPFACE_HOME"] = deepface_home
18
+
19
+ # Ensure the folder exists and is writable
20
+ os.makedirs(deepface_home, exist_ok=True)
21
 
22
 
23
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
 
92
  # }
93
  # }
94
 
95
+ # DATABASES = {
96
+ # "default": {
97
+ # "ENGINE": "django.db.backends.postgresql",
98
+ # "NAME": os.environ.get("DB_NAME", "factcheckapidb"),
99
+ # "USER": os.environ.get("DB_USER", "postgres"),
100
+ # "PASSWORD": os.environ.get("DB_PASSWORD", "postgres"),
101
+ # "HOST": os.environ.get("DB_HOST", "127.0.0.1"),
102
+ # "PORT": os.environ.get("DB_PORT", "5432"),
103
+ # }
104
+ # }
105
+
106
  DATABASES = {
107
+ 'default': {
108
+ 'ENGINE': os.getenv('DB_ENGINE', 'django.db.backends.sqlite3'), # Default to SQLite if not found
109
+ 'NAME': os.getenv('DB_NAME', BASE_DIR / 'db.sqlite3'),
110
+ 'USER': os.getenv('DB_USER', ''),
111
+ 'PASSWORD': os.getenv('DB_PASSWORD', ''),
112
+ 'HOST': os.getenv('DB_HOST', 'localhost'),
113
+ 'PORT': os.getenv('DB_PORT', '5432'),
114
  }
115
  }
116
 
manage.py CHANGED
@@ -3,7 +3,6 @@
3
  import os
4
  import sys
5
 
6
- os.environ["DEEPFACE_HOME"] = "./deepface_home"
7
 
8
  os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
9
  os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
 
3
  import os
4
  import sys
5
 
 
6
 
7
  os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
8
  os.environ["CUDA_VISIBLE_DEVICES"] = "-1"