File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change 12
12
13
13
import os
14
14
import dj_database_url
15
- import env
16
15
from django .contrib .messages import constants as messages
17
16
17
+ if os .environ .get ('DEVELOPMENT' ):
18
+ development = True
19
+ else :
20
+ development = False
21
+
22
+
18
23
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
19
24
BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
20
25
27
32
'SECRET_KEY' , 'r81y2+3y=qlb(=0-77rx3k07-8kqdqum5*rn@5a@j8ww194%5f' )
28
33
29
34
# SECURITY WARNING: don't run with debug turned on in production!
30
- DEBUG = True
35
+ DEBUG = development
31
36
32
37
ALLOWED_HOSTS = ['http://localhost:8000/' ,
33
38
os .environ .get ('HOSTNAME' ),
85
90
86
91
WSGI_APPLICATION = 'issue_tracker.wsgi.application'
87
92
88
-
89
93
# Database
90
94
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
91
-
92
- # sqlite3
93
- # DATABASES = {
94
- # 'default': {
95
- # 'ENGINE': 'django.db.backends.sqlite3',
96
- # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
97
- # }
98
- # }
99
-
100
- # postgresql
101
- DATABASES = {
102
- 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ))
103
- }
95
+ if development :
96
+ # sqlite3
97
+ DATABASES = {
98
+ 'default' : {
99
+ 'ENGINE' : 'django.db.backends.sqlite3' ,
100
+ 'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
101
+ }
102
+ }
103
+ else :
104
+ # Postgresql
105
+ DATABASES = {
106
+ 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ))
107
+ }
104
108
105
109
# Password validation
106
110
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
You can’t perform that action at this time.
0 commit comments