diff --git a/backend/app/settings.py b/backend/app/settings.py index 5df89e66..9c4d59f0 100644 --- a/backend/app/settings.py +++ b/backend/app/settings.py @@ -353,7 +353,12 @@ try: CELERY_BROKER_URL = env('CELERY_BROKER_URL') except EnvError: try: - CELERY_BROKER_URL = 'sqla+{}'.format(env('DATABASE_URL')) + # quickfix for Heroku. + # See https://github.com/doccano/doccano/issues/1327. + uri = env('DATABASE_URL') + if uri.startswith('postgres://'): + uri = uri.replace('postgres://', 'postgresql://', 1) + CELERY_BROKER_URL = 'sqla+{}'.format(uri) except EnvError: CELERY_BROKER_URL = 'sqla+sqlite:///{}'.format(DATABASES['default']['NAME']) CELERY_ACCEPT_CONTENT = ['application/json']