Giter Site home page Giter Site logo

cant start celery about django-cc HOT 4 CLOSED

limpbrains avatar limpbrains commented on June 12, 2024
cant start celery

from django-cc.

Comments (4)

limpbrains avatar limpbrains commented on June 12, 2024

Hi!

django-cc it's a library. You need to create your own project and add it to it.
Here tst - it's a name of your project. Your setup will be different.

Cheers

from django-cc.

kambic avatar kambic commented on June 12, 2024

i did create my own project and add library into. i got Currency model in db. so than i need to run tasks.py with celery to get it running ?

from django-cc.

limpbrains avatar limpbrains commented on June 12, 2024

After you created your project, you need to setup celery in it.
for example I have this celery.py config in my django project

from __future__ import absolute_import

import os

from celery import Celery

from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tst.settings')

CELERY_BROKER = getattr(
    settings,
    'CELERY_BROKER',
    'redis://localhost:6379/5')

app = Celery('tst', broker=CELERY_BROKER)

app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

@app.task(bind=True)
def debug_task(self):
    print('Request: {0!r}'.format(self.request))

then
celery worker -A tst.celery.app

read celery docs for more info

from django-cc.

Desperado1001 avatar Desperado1001 commented on June 12, 2024

Error:
Unable to load celery application.
The module dailyfresh was not found.

My celery configure like this:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dailyfresh.settings')
django.setup()

from goods.models import *
from django_redis import get_redis_connection

app = Celery('celery_tasks.tasks', broker='redis://127.0.0.1:6379/0')

from django-cc.

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.