Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:06:44+00:00 2026-06-12T13:06:44+00:00

I would like to set up a simple python app as a periodic celery

  • 0

I would like to set up a simple python app as a periodic celery task on an Ubuntu instance. I have followed the Celery documentation to set up the structure as recommended:

proj/__init__.py
/celery.py
/tasks.py

This works fine and I can run the periodic task from ../proj using:

celery worker -B --app=proj

I then copied in the celeryd and celerybeat files and edited the default files.

When I start the daemon, however, celeryd runs but does not seem to find the celery.py config and logs a connection refused error.

I think it must be related to the paths in:

#/etc/default/celeryd:

# Where to chdir at start.
CELERYD_CHDIR="/home/user/"

CELERY_CONFIG_MODULE="/home/user/proj"

I have left the other settings as specified in the docs, apart from changing the CELERYD_USER.

I feel I should be using –app in the config as well and perhaps specifying my python environment but I’m not sure where or how (I’m not running a virtual env).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:06:45+00:00Added an answer on June 12, 2026 at 1:06 pm

    I am struggling with the same thing right now. This is how I see it:

    There are two ends of the communication application that executes tasks and worker that executes task.

    Worker does not need to know app! For the worker part it is just enough to know celeryconfig. You could pass it with celery worker –config=mypackage.celeryconfig. The worker will connect to the queue with BROKER_URL. Remember to declare there CELERY_IMPORTS there so worker would know where to look for task definitions.

    The client app must know where to send it’s requests. So the same configuration must be passed with one of the methods of passing configuration file. I picked this one:

    from __future__ import absolute_import
    
    from celery import Celery
    celery = Celery()
    import backend.async.celeryconfig
    celery.config_from_object(backend.async.celeryconfig)
    

    This setup works for me when I run it without deamon, but for some reason deamon ignores my CELERY_CONFIG_MODULE settings.


    Update:

    CELERY_CONFIG_MODULE is not used in /etc/init.d/celeryd script anywhere!

    Instead, I put it in CELERYD_OPTS and it works like a charm.:

    CELERYD_OPTS="--config=backend.async.celeryconfig"
    

    The other thing is that VIRTUAL_ENV variable is ignored as well in celeryd script. On the other celerybeat scirpt activates the virtual env, so my adviced config is:

    CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule --config=backend.async.celeryconfig"
    
    VIRTUAL_ENV="/path/to/.virtualenvs/your_env"
    
    # Python interpreter from environment.
    ENV_PYTHON="$VIRTUAL_ENV/bin/python"
    
    # How to call "celeryd-multi"
    CELERYD_MULTI="$VIRTUAL_ENV/bin/celeryd-multi"
    
    #CELERYD="$VIRTUAL_ENV/celeryd"
    
    # How to call "celeryctl"
    CELERYCTL="$VIRTUAL_ENV/bin/celeryctl"
    
    # How to call "celerybeat"
    CELERYBEAT="$VIRTUAL_ENV/bin/celerybeat"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement a very simple web-server-like app in Python which would perform
I would like to set up a very simple demo application that includes LINQ
Given a simple data set, I would like to be able to calculate a
I have this simple python expression: fscript.write ((update %s va set %s = %s
I have an array of Python objects, and I would like to get all
I used the same command syntax above as in Mysql and would like set
I would like to set some values in context.xml file and access the same
I would like to set the date in a Windows batch file to 7
I would like to set up a system that use both technologies at the
I would like to set a variable in bash called test_var Basically, I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.