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

  • Home
  • SEARCH
  • 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 8386129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:51:00+00:00 2026-06-09T17:51:00+00:00

I posted a question : How to execute a command at exact time once

  • 0

I posted a question :How to execute a command at exact time once a day in Django?

I got my answer that the Celery is the easiest option to do it, but now i have another question regarding the celery:

from celery.schedules import crontab

CELERYBEAT_SCHEDULE = {
    # Executes every Monday morning at 7:30 A.M
    'every-monday-morning': {
        'task': 'tasks.add',
        'schedule': crontab(hour=7, minute=30, day_of_week=1),
        'args': (16, 16),
    },
}

I have three question in regarding the above code i.e:

  • I have to execute execute_command(User, command) method. I want that this method will execute at the given scheduled time.

  • What if i want to change the schedule at 7:30 AM but every weekdays?.

  • What about the args. In my case should i pass the value of User and command from args. Or i can simply pass from the task key ?

I just read the docs of celery, but didn’t got my answer. Would you please help me?

  • 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-09T17:51:02+00:00Added an answer on June 9, 2026 at 5:51 pm

    Did you find the Celery periodic tasks documentation?

    • You’ll have to use the identifier of your method to register a scheduler entry. If your execute_command task lives in a module named foobar, the task value of the CELERYBEAT_SCHEDULE structure should be foobar.execute_command.

      Celery will import the task for you, provided that import foobar.execute_command would work.

    • Check the celery.schedule.crontab API; the following should execute on weekdays at 07:30 am:

      crontab(minute=30, hour=7, day_of_week=’mon-fri’)
      
    • Remember that this task is going to be performed asynchronously. You cannot query for a database object when you schedule this task and expect it to be there still when the task is called.

      Thus, you should only pass in python values that remain constant, and have your task connect to the database and look things up based on the arguments you pass in.

      If this task is only ever going to execute tasks for one specific user, then by all means pass in the identifier for that user (user id, email, whatever you can use to look up the user from the database).

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

Sidebar

Related Questions

Yesterday, I posted an answer to a question that included several (unknown to me
I posted a question about keys yesterday, and got very helpful responses. I've been
This question is following a previous one which i posted: Django Callback on Facebook
I posted this question earlier about dynamically compiling code in C#, and the answer
I posted a question about how to save the result of an SQL command
I've posted variations of this question before and just as I think I've got
I posted a question some time ago on MSDN forum involving the following code.
Yesterday I've posted question about SQLite performance issues ( Terrible performance in Zend Db
I posted a question here concerning creating a shopping cart. It seems maybe I
I posted a question last night about Java Reflection and am discovering compiler warnings

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.