Skip to content

Commit 20cf675

Browse files
authored
Merge pull request #5 from SocialSchools/fix/issue-with-postgres-not-running-ci
fix: postgres was not getting init because of wrong url
2 parents 7c5f996 + b6a73f0 commit 20cf675

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

quickstart/settings.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,19 @@
145145
# environment variable is available, e.g. during Docker build
146146
DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite://:memory:')
147147

148-
DATABASES = {'default': dj_database_url.parse(DATABASE_URL)}
148+
if not os.environ.get('CI', False):
149+
DATABASES = {'default': dj_database_url.parse(DATABASE_URL)}
150+
else:
151+
DATABASES = {
152+
'default': {
153+
'ENGINE': 'django.db.backends.postgresql',
154+
'NAME': 'postgres',
155+
'USER': 'postgres',
156+
'PASSWORD': 'postgres',
157+
'HOST': '127.0.0.1',
158+
'PORT': '5432',
159+
}
160+
}
149161

150162

151163
# Password validation

0 commit comments

Comments
 (0)