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 8282WSGI_APPLICATION = 'issue_tracker.wsgi.application'
8383
8484# 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." )
88106 DATABASES = {
89107 'default' : {
90108 'ENGINE' : 'django.db.backends.sqlite3' ,
91109 'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
92110 }
93111 }
94- else :
95- print ('DATABASE: POSTGRESQL' )
96- DATABASES = {
97- 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ))
98- }
112+
99113
100114# Password validation
101- # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
102115
103116AUTH_PASSWORD_VALIDATORS = [
104117 {
117130
118131
119132# Internationalization
120- # https://docs.djangoproject.com/en/1.11/topics/i18n/
121133
122134LANGUAGE_CODE = 'en-us'
123135
You can’t perform that action at this time.
0 commit comments