Browse Source
Merge pull request #1331 from doccano/fix1327
Replace postgres url for heroku
pull/1332/head
Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
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'] |
|
|
|