Skip to content

Commit 83548c7

Browse files
committed
Add Celery
1 parent f8325c2 commit 83548c7

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

core/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .celery import app as celery_app
2+
3+
__all__ = ("celery_app",)

core/celery.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import os
2+
3+
from celery import Celery
4+
5+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
6+
7+
app = Celery("core")
8+
app.config_from_object("django.conf:settings", namespace="CELERY")
9+
app.autodiscover_tasks()

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ services:
1616

1717
celery:
1818
build: .
19-
command: celery -A web worker -l info
19+
command: celery -A core worker -l info
2020
volumes:
2121
- .:/usr/src/app/
2222
depends_on:
2323
- redis
2424
celery-beat:
2525
build: .
26-
command: celery -A web beat -l info
26+
command: celery -A core beat -l info
2727
volumes:
2828
- .:/usr/src/app/
2929
depends_on:

requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Celery - Redis
22
# ------------------------------------------------------------------------------
3-
celery==5.2.3 # pyup: < 6.0 # https://github.com/celery/celery
4-
flower==1.0.0 # https://github.com/mher/flower
3+
celery==4.2.1 # pyup: < 6.0 # https://github.com/celery/celery
4+
# flower==1.0.0 # https://github.com/mher/flower
55
redis==4.1.0 # https://github.com/redis/redis-py
66

77
# Django
88
# ------------------------------------------------------------------------------
99
django==3.2.11 # pyup: < 4.0 # https://www.djangoproject.com/
1010
django-redis==5.2.0 # https://github.com/jazzband/django-redis
11-
django-celery-beat==2.2.1 # https://github.com/celery/django-celery-beat
11+
# django-celery-beat==2.2.1 # https://github.com/celery/django-celery-beat
1212
psycopg2-binary==2.9.3 # https://github.com/psycopg/psycopg2
1313
django_filter==2.4.0 # https://github.com/carltongibson/django-filter
1414

1515
# Django REST Framework
1616
djangorestframework==3.13.1 # https://github.com/encode/django-rest-framework
17-
django-cors-headers==3.10.1 # https://github.com/adamchainz/django-cors-headers
17+
django-cors-headers==3.10.1 # https://github.com/adamchainz/django-cors-headers

0 commit comments

Comments
 (0)