浏览代码

Fallback CELERY_TIMEZONE to Django's TIME_ZONE

Ask Solem 12 年之前
父节点
当前提交
43de06a2d2
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      celery/app/utils.py

+ 5 - 0
celery/app/utils.py

@@ -52,6 +52,11 @@ class Settings(datastructures.ConfigurationView):
         return (os.environ.get('CELERY_BROKER_URL') or
                 self.first('BROKER_URL', 'BROKER_HOST'))
 
+    @property
+    def CELERY_TIMEZONE(self):
+        # this way we also support django's time zone.
+        return self.first('CELERY_TIMEZONE', 'TIME_ZONE')
+
     def without_defaults(self):
         """Returns the current configuration, but without defaults."""
         # the last stash is the default settings, so just skip that