Browse Source

Replace postgres url for heroku, fix #1327

pull/1331/head
Hironsan 3 years ago
parent
commit
a64628e3bb
1 changed files with 6 additions and 1 deletions
  1. 7
      backend/app/settings.py

7
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']

Loading…
Cancel
Save