File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change 82
82
WSGI_APPLICATION = 'issue_tracker.wsgi.application'
83
83
84
84
# Database
85
- # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
86
- if development :
87
- print ('DATABASE: SQLITE3' )
85
+ # if development:
86
+ # print('DATABASE: SQLITE3')
87
+ # DATABASES = {
88
+ # 'default': {
89
+ # 'ENGINE': 'django.db.backends.sqlite3',
90
+ # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
91
+ # }
92
+ # }
93
+ # else:
94
+ # print('DATABASE: POSTGRESQL')
95
+ # DATABASES = {
96
+ # 'default': dj_database_url.parse(os.environ.get('DATABASE_URL'))
97
+ # }
98
+
99
+ if "DATABASE_URL" in os .environ and development == False :
100
+ print ('Database URL found. Using POSTGRESQL' )
101
+ DATABASES = {
102
+ 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ))
103
+ }
104
+ else :
105
+ print ("Database URL not found. Using SQLite instead." )
88
106
DATABASES = {
89
107
'default' : {
90
108
'ENGINE' : 'django.db.backends.sqlite3' ,
91
109
'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
92
110
}
93
111
}
94
- else :
95
- print ('DATABASE: POSTGRESQL' )
96
- DATABASES = {
97
- 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ))
98
- }
112
+
99
113
100
114
# Password validation
101
- # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
102
115
103
116
AUTH_PASSWORD_VALIDATORS = [
104
117
{
117
130
118
131
119
132
# Internationalization
120
- # https://docs.djangoproject.com/en/1.11/topics/i18n/
121
133
122
134
LANGUAGE_CODE = 'en-us'
123
135
You can’t perform that action at this time.
0 commit comments