Comments (12)
@tsantor try to add on your proj/proj/__init__.py
from .celery import celery_app
from django-celery-beat.
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.
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.
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.
@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.
I think, this could be because of the celery autodiscover_tasks
not working as intended.
from django-celery-beat.
@dagnaldo thanks , it works
from django-celery-beat.
@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.
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.
@tsantor try to add on your
proj/proj/__init__.py
from .celery import celery_app
it works, thanks a lot
from django-celery-beat.
@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.
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)
- Minor documentation error HOT 1
- The celery beat is not syncing and you need to manually restart it to reflect changes! HOT 3
- SCHEDULER Time display issue
- Custom schedule type is not being used
- django 5.0 HOT 24
- CrontabSchedule uniqueness HOT 3
- celery beat_schedule can not automove HOT 1
- schedule task HOT 1
- (Django 5.0.1) AttributeError at /admin/django_celery_beat/crontabschedule/add/ HOT 3
- can I reduce number of beats? HOT 1
- I think there is no longer a need for `self.celery_app.loader.import_default_modules()` in the admin HOT 7
- Received unregistered task of type <app.tasks.function_name> HOT 1
- Rethinking total_run_count reset for one-off tasks in is_due HOT 1
- Add `sphinxcontrib-django` to docs extensions
- Error in logfile HOT 3
- Getting RuntimeWarning with django-celery-beat==2.6.0, django==5.0.3 HOT 7
- Admin: show tasks for each schedule
- Scheduled tasks not running despite showing in beat config HOT 1
- Invalid crontab is created, but breaks database scheduler
- migration returns error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-celery-beat.