コード例 #1
0
ファイル: apps.py プロジェクト: weimens/django-post_office
    def ready(self):
        from post_office import tasks
        from post_office.settings import get_celery_enabled
        from post_office.signals import email_queued

        if get_celery_enabled():
            email_queued.connect(tasks.queued_mail_handler)
コード例 #2
0
    def ready(self):
        from post_office.signals import email_queued

        try:
            queued_mail_handler = import_string(
                'post_office.tasks.queued_mail_handler')
            email_queued.connect(queued_mail_handler)
        except ImportError:
            pass  # Celery is not installed
コード例 #3
0
    def ready(self):
        from actstream import registry
        registry.register(self.get_model('Email'))
        registry.register(self.get_model('EmailTemplate'))

        from post_office import tasks
        from post_office.signals import email_queued

        if hasattr(tasks, 'queued_mail_handler'):
            email_queued.connect(tasks.queued_mail_handler)
コード例 #4
0
    def ready(self):
        from post_office import tasks
        from post_office.signals import email_queued

        if hasattr(tasks, 'queued_mail_handler'):
            email_queued.connect(tasks.queued_mail_handler)