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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:48:07+00:00 2026-06-03T01:48:07+00:00

I am hoping to be able to programmatically generate celerybeat entries and resync celerybeat

  • 0

I am hoping to be able to programmatically generate celerybeat entries and resync celerybeat when entries are added. The docs here state

By default the entries are taken from the CELERYBEAT_SCHEDULE setting, but custom stores can also be used, like storing the entries in an SQL database.

So I am trying to figure out which classes i need to extend to be able to do this.

I have been looking at celery scheduler docs and djcelery api docs but the documentation on what some of these methods do is non-existent so about to dive into some source and was just hoping someone could point me in the right direction.

I guess a high level of what I’m doing would be helpful… As a user I need to be able to select from a predefined set of tasks and provide a way for a user to select some sort of custom schedule for it to execute, like every day/week/month and what day and time.

Also this is in Django with djcelery.

UPDATE

I see the code for the djcelery admin but am not clear on how that data is being persisted. I currently have a generic addTask view that looks like this :

def addTask(request):

intervalSchedule = IntervalSchedule.from_schedule(schedule(timedelta(seconds=10)))
intervalSchedule.save()
modelData = dict(
    name="dcTestPersist",
    task="technologytrackerapi.views.createRecord",
    schedule=intervalSchedule,
)
periodicTask = PeriodicTask(**modelData)
periodicTask.save()
return render_to_response('taskView.html')

The data looks correct in the db but when the daemon runs it has this error :

[2012-03-06 00:23:07,926: WARNING/Beat] Process Beat:
[2012-03-06 00:23:07,926: WARNING/Beat] Traceback (most recent call last):
[2012-03-06 00:23:07,926: WARNING/Beat] File “/usr/lib/python2.7/multiprocessing/process.py”, line 258, in _bootstrap
[2012-03-06 00:23:07,926: WARNING/Beat] self.run()
[2012-03-06 00:23:07,927: WARNING/Beat] File “/home/dchesterman/Documents/PythonDev/.virtualenvs/ros/local/lib/python2.7/site-packages/celery/beat.py”, line 464, in run
[2012-03-06 00:23:07,927: WARNING/Beat] self.service.start(embedded_process=True)
[2012-03-06 00:23:07,927: WARNING/Beat] File “/home/dchesterman/Documents/PythonDev /.virtualenvs/ros/local/lib/python2.7/site-packages/celery/beat.py”, line 403, in start
[2012-03-06 00:23:07,927: WARNING/Beat] interval = self.scheduler.tick()
[2012-03-06 00:23:07,927: WARNING/Beat] File “/home/dchesterman/Documents/PythonDev/.virtualenvs/ros/local/lib/python2.7/site-packages/celery/beat.py”, line 194, in tick
[2012-03-06 00:23:07,927: WARNING/Beat] next_time_to_run = self.maybe_due(entry, self.publisher)
[2012-03-06 00:23:07,927: WARNING/Beat] File “/home/dchesterman/Documents/PythonDev/.virtualenvs/ros/local/lib/python2.7/site-packages/celery/beat.py”, line 170, in maybe_due
[2012-03-06 00:23:07,927: WARNING/Beat] is_due, next_time_to_run = entry.is_due()
[2012-03-06 00:23:07,928: WARNING/Beat] File “/home/dchesterman/Documents/PythonDev/.virtualenvs/ros/local/lib/python2.7/site-packages/djcelery/schedulers.py”, line 54, in is_due
[2012-03-06 00:23:07,928: WARNING/Beat] return self.schedule.is_due(self.last_run_at)
[2012-03-06 00:23:07,928: WARNING/Beat] AttributeError: ‘NoneType’ object has no attribute ‘is_due’

I’m not sure why my schedule does not use the default is_due()

  • 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-03T01:48:09+00:00Added an answer on June 3, 2026 at 1:48 am

    This is what ended up working for me :

    def addTask(request):
    
      intervalSchedule = IntervalSchedule.from_schedule(schedule(timedelta(seconds=10)))
      intervalSchedule.save()
    
      modelData = dict(
          name="dcTestPersist",
          task="technologytrackerapi.tasks.createRecord",
          interval_id=intervalSchedule.pk,
      )
    
      periodicTask = PeriodicTask(**modelData)
      periodicTask.save()
    
      me = ModelEntry(periodicTask)
    
      try:
          me.save()
    
      except:
        from django.db import connection
        print connection.queries
        raise
    
      return render_to_response('taskView.html')
    

    I had to wrap the Periodic Task in a ModelEntry.

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

Sidebar

Related Questions

I have this piece of code which I'm hoping will be able to tell
I was hoping somebody might be able to give me a hand by pointing
I'm having some strange drawing artefacts that I'm hoping someone might be able to
Hoping that anybody here knows about a good one: I'm looking for a (free
Hoping some learned Rails developers here can recommend an existing Ruby on Rails plugin
I am in way over my head, and am hoping anyone here can help.
I am hoping to be able to use a simple batch file to be
I was hoping to be able to find a tool,application or script that takes
Pretty new to jquery but i was hoping to be able to target a
I was hoping to be able to augment Array.prototype with methods and then call

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.