adding: celery
This commit is contained in:
@@ -12,10 +12,6 @@ ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "*").split(" ")
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = os.getenv("CSRF_TRUSTED_ORIGINS", "http://* https://*").split(" ")
|
||||
|
||||
REDIS_HOST = os.getenv("REDIS_HOST")
|
||||
REDIS_PORT = int(os.getenv("REDIS_PORT"))
|
||||
REDIS_PASSWORD = os.getenv("REDIS_PASSWORD")
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
@@ -23,7 +19,9 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'application'
|
||||
'application.apps.ApplicationConfig',
|
||||
'djangoql',
|
||||
'django_celery_results'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@@ -98,3 +96,18 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
|
||||
|
||||
REDIS_HOST = os.getenv("REDIS_HOST")
|
||||
REDIS_PORT = int(os.getenv("REDIS_PORT"))
|
||||
REDIS_PASSWORD = os.getenv("REDIS_PASSWORD")
|
||||
|
||||
RABBIT_HOST = os.getenv("RABBIT_HOST")
|
||||
RABBIT_PORT = int(os.getenv("RABBIT_PORT"))
|
||||
RABBIT_LOGIN = os.getenv("RABBIT_LOGIN")
|
||||
RABBIT_PASSWORD = os.getenv("RABBIT_PASSWORD")
|
||||
RABBIT_VHOST = os.getenv("RABBIT_VHOST")
|
||||
|
||||
CELERY_BROKER_URL = f'amqp://{RABBIT_LOGIN}:{RABBIT_PASSWORD}@{RABBIT_HOST}:{RABBIT_PORT}/{RABBIT_VHOST}'
|
||||
CELERY_RESULT_BACKEND = 'django-db'
|
||||
CELERY_CACHE_BACKEND = 'django-cache'
|
||||
CELERY_RESULT_EXTENDED = True
|
||||
|
||||
Reference in New Issue
Block a user