Merge branch 'refs/heads/master' into Docker
# Conflicts: # konova/celery.py
This commit is contained in:
commit
ed6763092b
@ -12,6 +12,10 @@ DB_NAME=konova
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=5432
|
||||
|
||||
# Redis (for celery)
|
||||
REDIS_HOST=CHANGE_ME
|
||||
REDIS_PORT=CHANGE_ME
|
||||
|
||||
# E-Mail
|
||||
SMTP_HOST=localhost
|
||||
SMTP_PORT=25
|
||||
|
@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
from celery import Celery
|
||||
from konova.sub_settings.django_settings import env
|
||||
|
||||
# Set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'konova.settings')
|
||||
@ -17,7 +18,7 @@ app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||
app.autodiscover_tasks()
|
||||
|
||||
# Declare redis as broker
|
||||
app.conf.broker_url = f"redis://{os.environ.get('REDIS_HOST')}:6379/0"
|
||||
app.conf.broker_url = f'redis://{env("REDIS_HOST")}:{env.int("REDIS_PORT")}/0'
|
||||
|
||||
|
||||
@app.task(bind=True)
|
||||
|
Loading…
Reference in New Issue
Block a user