|
|
@ -195,6 +195,8 @@ LOGIN_URL = '/login/' |
|
|
|
LOGIN_REDIRECT_URL = '/projects/' |
|
|
|
LOGOUT_REDIRECT_URL = '/' |
|
|
|
|
|
|
|
django_heroku.settings(locals(), test_runner=False) |
|
|
|
|
|
|
|
# Change 'default' database configuration with $DATABASE_URL. |
|
|
|
DATABASES['default'].update(dj_database_url.config( |
|
|
|
env='DATABASE_URL', |
|
|
@ -202,6 +204,10 @@ DATABASES['default'].update(dj_database_url.config( |
|
|
|
ssl_require='sslmode' not in furl(env('DATABASE_URL', '')).args, |
|
|
|
)) |
|
|
|
|
|
|
|
# work-around for dj-database-url: explicitly disable ssl for sqlite |
|
|
|
if DATABASES['default'].get('ENGINE') == 'django.db.backends.sqlite3': |
|
|
|
DATABASES['default'].get('OPTIONS', {}).pop('sslmode', None) |
|
|
|
|
|
|
|
# Honor the 'X-Forwarded-Proto' header for request.is_secure() |
|
|
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') |
|
|
|
|
|
|
@ -218,11 +224,3 @@ AZURE_APPINSIGHTS_IKEY = env('AZURE_APPINSIGHTS_IKEY', None) |
|
|
|
APPLICATION_INSIGHTS = { |
|
|
|
'ikey': AZURE_APPINSIGHTS_IKEY if AZURE_APPINSIGHTS_IKEY else None, |
|
|
|
} |
|
|
|
|
|
|
|
# work-around for django-heroku: don't overwrite sslmode outside of heroku |
|
|
|
if env.bool('IS_HEROKU', True): |
|
|
|
django_heroku.settings(locals(), test_runner=False) |
|
|
|
|
|
|
|
# work-around for dj-database-url: explicitly disable ssl for sqlite |
|
|
|
if DATABASES['default'].get('ENGINE') == 'django.db.backends.sqlite3': |
|
|
|
DATABASES['default'].get('OPTIONS', {}).pop('sslmode', None) |