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 7806043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:24:21+00:00 2026-06-02T02:24:21+00:00

If I have a function defined as follows: def add(x,y): return x+y Is there

  • 0

If I have a function defined as follows:

def add(x,y):
  return x+y

Is there a way to dynamically add this function as a celery PeriodicTask and kick it off at runtime? I’d like to be able to do something like (pseudocode):

some_unique_task_id = celery.beat.schedule_task(add, run_every=crontab(minute="*/30"))
celery.beat.start(some_unique_task_id)

I would also want to stop or remove that task dynamically with something like (pseudocode):

celery.beat.remove_task(some_unique_task_id)

or

celery.beat.stop(some_unique_task_id)

FYI I am not using djcelery, which lets you manage periodic tasks via the django admin.

  • 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-02T02:24:23+00:00Added an answer on June 2, 2026 at 2:24 am

    No, I’m sorry, this is not possible with the regular celerybeat.

    But it’s easily extensible to do what you want, e.g. the django-celery
    scheduler is just a subclass reading and writing the schedule to the database
    (with some optimizations on top).

    Also you can use the django-celery scheduler even for non-Django projects.

    Something like this:

    • Install django + django-celery:

      $ pip install -U django django-celery

    • Add the following settings to your celeryconfig:

      DATABASES = {
          'default': {
              'NAME': 'celerybeat.db',
              'ENGINE': 'django.db.backends.sqlite3',
          },
      }
      INSTALLED_APPS = ('djcelery', )
      
    • Create the database tables:

      $ PYTHONPATH=. django-admin.py syncdb --settings=celeryconfig
      
    • Start celerybeat with the database scheduler:

      $ PYTHONPATH=. django-admin.py celerybeat --settings=celeryconfig \
          -S djcelery.schedulers.DatabaseScheduler
      

    Also there’s the djcelerymon command which can be used for non-Django projects
    to start celerycam and a Django Admin webserver in the same process, you can
    use that to also edit your periodic tasks in a nice web interface:

       $ djcelerymon
    

    (Note for some reason djcelerymon can’t be stopped using Ctrl+C, you
    have to use Ctrl+Z + kill %1)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my object defined as follows: function KoolTabs() { this.targetName = ; this.activeNode
i have a function defined as follows: void AddHeadCode(std::ofstream &ostream, size_t length){ ostream.write((char*)length, sizeof(length));
I have a function defined like this: public static void ShowAbout(Point location, bool stripSystemAssemblies
I have an inline member function defined under class MyClass int MyClass::myInlineFunction(); This function
I have a large function which has a vector defined as follows: v <-
I have a python function defined as follows which i use to delete from
I have a function in a native DLL defined as follows: #include <string> void
I have a member function that is defined as follows: Value JSONDeserializer::ParseValue(TDR type, const
I have a C function defined as follows: int s3vold_(void) {...} To create a
I have my URL defined as follows: (r'^article/edit/(.*)/$', 'mysite.views.edit_article') And the function defined as:

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.