LPgenerator / django-db-mailer

Django module to easily send emails/sms/tts/push using django templates stored on database and managed through the Django Admin
https://github.com/LPgenerator/django-db-mailer
GNU General Public License v2.0
255 stars 81 forks source link

Using celery without djcelery #87

Closed DimaKudosh closed 7 years ago

DimaKudosh commented 7 years ago

Hello, DB mailer works with celery only when djcelery is installed. But with latest version of celery it's possible to use celery with django without this library. How I can use db-mailer with celery without djcelery installed?

gotlium commented 7 years ago

Hi, can you show errors when celery is not installed?

DimaKudosh commented 7 years ago

It doesn't raise any error, it just ignore use_celery parameter when djcelery isn't installed. In your init.py you have following code:

def celery_supported():
    try:
        from dbmail import tasks
        if not app_installed('djcelery'):
            raise ImportError
        return True
    except ImportError:
        return False

So celery_supported will always return False if you haven't djcelery, even if you use celery in your project.

gotlium commented 7 years ago

Can you try disable this code, and check how app working without djcelery?

DimaKudosh commented 7 years ago

After disabling this code it works fine, so problem in this function.

gotlium commented 7 years ago

what about queue and another functionality?

gotlium commented 7 years ago

and additional question: how we can check celery configuration without djcelery app?

DimaKudosh commented 7 years ago

I setup celery using this tutorial from docs http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html. Then I run celery using this command celery -A project worker -l info -Q default. Also in django-celery repo I found this warning

THIS PROJECT IS ONLY REQUIRED IF YOU WANT TO USE DJANGO RESULT BACKEND AND ADMIN INTEGRATION

So I didn't install it because admin integration and results not important for me.