File tree 4 files changed +28
-5
lines changed
4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change
1
+ web : gunicorn boarddash.wsgi
Original file line number Diff line number Diff line change 11
11
"""
12
12
13
13
import os
14
+ import django_heroku
14
15
15
16
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16
17
BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
19
20
# Quick-start development settings - unsuitable for production
20
21
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
21
22
22
- # SECURITY WARNING: keep the secret key used in production secret!
23
- SECRET_KEY = 'q7!62))q4n1+5pe($nhoq#p#xpm2kgm1b0%^sozedh#$a2+@=x'
23
+ SECRET_KEY = "{{ secret_key }}"
24
24
25
25
# SECURITY WARNING: don't run with debug turned on in production!
26
- DEBUG = True
26
+ DEBUG = os . environ . get ( "DEBUG" ) == "1"
27
27
28
28
ALLOWED_HOSTS = []
29
29
77
77
78
78
DATABASES = {
79
79
'default' : {
80
- 'ENGINE' : 'django.db.backends.sqlite3' ,
81
- 'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
80
+ 'ENGINE' : 'django.db.backends.postgresql' ,
81
+ 'NAME' : 'postgres' ,
82
+ 'USER' : 'postgres' ,
83
+ 'HOST' : 'db' ,
84
+ 'PORT' : 5432 ,
82
85
}
83
86
}
84
87
88
+ import dj_database_url
89
+ DATABASES ['default' ].update (dj_database_url .config (conn_max_age = 500 ))
85
90
86
91
# Password validation
87
92
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
122
127
STATIC_URL = '/static/'
123
128
124
129
REQUESTS_TIMEOUT_SECONDS = 20
130
+
131
+ # Activate Django-Heroku.
132
+ django_heroku .settings (locals (), logging = not DEBUG , databases = not DEBUG )
133
+
Original file line number Diff line number Diff line change 1
1
version : ' 3'
2
2
3
+ volumes :
4
+ postgres-data :
5
+ driver : local
6
+
3
7
services :
4
8
db :
5
9
image : postgres
10
+ volumes :
11
+ - postgres-data:/var/lib/postgresql/data
6
12
web :
7
13
build : .
8
14
volumes :
9
15
- .:/code
10
16
ports :
11
17
- " 8000:8000"
18
+ environment :
19
+ - DATABASE_URL=postgres://postgres:postgres@db/postgres
20
+ - SECRET_KEY=developmentkittenssup
21
+ - DEBUG=1
12
22
depends_on :
13
23
- db
Original file line number Diff line number Diff line change 1
1
django == 2.1.1
2
2
django-bootstrap4 == 0.0.7
3
3
requests == 2.19.1
4
+ gunicorn == 19.9.0
5
+ django-heroku
6
+ dj_database_url
You can’t perform that action at this time.
0 commit comments