!75 修复celery时区问题

Merge pull request !75 from 木子-李/N/A
This commit is contained in:
dvadmin
2024-08-29 00:14:27 +00:00
committed by Gitee
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
__all__ = ('celery_app',)

View File

@@ -15,7 +15,7 @@ else:
from celery import Celery
app = Celery(f"application")
app.config_from_object('django.conf:settings')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
platforms.C_FORCE_ROOT = True