File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change 162
162
}
163
163
164
164
# Database Configuration
165
- DATABASES = {
166
- "default" : {
167
- "ENGINE" : "django.db.backends.postgresql" ,
168
- "NAME" : POSTGRES_NAME ,
169
- "USER" : POSTGRES_USER ,
170
- "PASSWORD" : POSTGRES_PASSWORD ,
171
- "HOST" : POSTGRES_HOST ,
172
- "PORT" : POSTGRES_PORT ,
173
- "OPTIONS" : {
174
- "sslmode" : "prefer" ,
175
- },
165
+ # Only configure PostgreSQL if not in testing mode
166
+ if not TESTING :
167
+ DATABASES = {
168
+ "default" : {
169
+ "ENGINE" : "django.db.backends.postgresql" ,
170
+ "NAME" : POSTGRES_NAME ,
171
+ "USER" : POSTGRES_USER ,
172
+ "PASSWORD" : POSTGRES_PASSWORD ,
173
+ "HOST" : POSTGRES_HOST ,
174
+ "PORT" : POSTGRES_PORT ,
175
+ "OPTIONS" : {
176
+ "sslmode" : "prefer" ,
177
+ },
178
+ }
179
+ }
180
+ else :
181
+ DATABASES = {
182
+ "default" : {
183
+ "ENGINE" : "django.db.backends.sqlite3" ,
184
+ "NAME" : ":memory:" ,
185
+ }
176
186
}
177
- }
178
187
179
188
# Dual-Write Configuration
180
189
DUAL_WRITE_ENABLED = os .getenv ("DUAL_WRITE_ENABLED" , "True" ).lower () == "true"
You can’t perform that action at this time.
0 commit comments