Giter Site home page Giter Site logo

Comments (12)

dagnaldo avatar dagnaldo commented on July 17, 2024 44

@tsantor try to add on your proj/proj/__init__.py

from .celery import celery_app

from django-celery-beat.

pramttl avatar pramttl commented on July 17, 2024 17

Sorry, this issue has nothing to do with django-celery-beat. Just for anyone's reference who hits this issue page in future, I'll describe what solved the issue for me. I had not replaced django.conf:settings in the celery.py file with the django settings variable.

In proj/proj/celery.py, this line:

celery_app.config_from_object('django.conf:settings', namespace='CELERY')

Should be,

celery_app.config_from_object(settings, namespace='CELERY')

Don't forget thefrom django.conf import settings at the top of the file.

from django-celery-beat.

Teketel avatar Teketel commented on July 17, 2024 8

celery_app.config_from_object(settings, namespace='CELERY')
Don't forget thefrom django.conf import settings at the top of the file.
This does not work for me

from django-celery-beat.

tsantor avatar tsantor commented on July 17, 2024 2

I agree, this issue has nothing to do with django-celery-beat as I am experiencing the same issue, but have not been able to find a solution anywhere. The bound task in celery.py is found, but the shared tasks in any appname/tasks.py files are not found.

@pramttl - the solution you suggested does not work for me either.

from django-celery-beat.

kishorpawar avatar kishorpawar commented on July 17, 2024 1

@tsantor try to add on your proj/proj/__init__.py

from .celery import celery_app

It is imported as said in the quick start guide, but still shared_task is not showing up.
Though importing django.conf.settings fixed recurrsion error.

from django-celery-beat.

pramttl avatar pramttl commented on July 17, 2024

I think, this could be because of the celery autodiscover_tasks not working as intended.

from django-celery-beat.

diemus avatar diemus commented on July 17, 2024

@dagnaldo thanks , it works

from django-celery-beat.

chrisconlan avatar chrisconlan commented on July 17, 2024

@dagnaldo and his answer should be in the quick start guide. Been using celery for a year and never had to reach for this solution before.

from django-celery-beat.

srini-pen avatar srini-pen commented on July 17, 2024

from django.conf import settings

app.config_from_object(settings)

It's working for me and able to see shared_task

from django-celery-beat.

Ronnie08 avatar Ronnie08 commented on July 17, 2024

@tsantor try to add on your proj/proj/__init__.py

from .celery import celery_app

it works, thanks a lot

from django-celery-beat.

UlrichEschcol avatar UlrichEschcol commented on July 17, 2024

@tsantor try to add on your proj/proj/__init__.py

from .celery import celery_app

it works for me. Great. Thanks

from django-celery-beat.

DevilsAutumn avatar DevilsAutumn commented on July 17, 2024

Hi, I am facing a similar problem ,tried both the above solutions but they didn't work.
backend/celery.py

import os

from celery import Celery
from django.conf import settings


from config.redis import redis_instance

# Set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings")

ri = redis_instance()

app = Celery("backend")

# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object(settings, namespace="CELERY")

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

@app.task(bind=True)
def hello():
    print ("This task is registering successfully")

backend/backend/init.py

from .celery import app as celery_app

__all__ = ('celery_app',)

I have my task in backend/app/tasks.py and its not showing up in registered tasks without importing in view.py

from django-celery-beat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.