Skip to content

Commit 534bc76

Browse files
author
Samuel Rodrigues
committed
Added django-database-url package
1 parent 2649be0 commit 534bc76

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Diff for: mergify/settings.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from pathlib import Path
1414

1515
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
import dj_database_url
17+
1618
BASE_DIR = Path(__file__).resolve().parent.parent
1719

1820
SECRET_KEY = 'Not_the_actual_key'
@@ -64,12 +66,7 @@
6466

6567
WSGI_APPLICATION = 'mergify.wsgi.application'
6668

67-
DATABASES = {
68-
'default': {
69-
'ENGINE': 'django.db.backends.sqlite3',
70-
'NAME': BASE_DIR / 'db.sqlite3'
71-
}
72-
}
69+
DATABASES = {"default": dj_database_url.config(conn_max_age=600)}
7370

7471
# Password validation
7572
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators

Diff for: requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ requests==2.28.1
77
dynaconf~=3.1.9
88
django-q~=1.3.9
99
mysqlclient~=2.1.1
10-
gunicorn~=20.1.0
10+
gunicorn~=20.1.0
11+
django-database-url~=1.0.3

Diff for: settings.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ dev:
1111
bulk: 10
1212
orm: default
1313
catch_up: False
14+
DATABASES:
15+
'default':
16+
NAME: db.sqlite3
17+
ENGINE: django.db.backends.sqlite3
1418
production:
1519
ALLOWED_HOSTS:
1620
- 'mergify.net'

0 commit comments

Comments
 (0)