Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up a recurrent task #55

Open
AnselmC opened this issue Oct 19, 2024 · 1 comment
Open

Setting up a recurrent task #55

AnselmC opened this issue Oct 19, 2024 · 1 comment

Comments

@AnselmC
Copy link

AnselmC commented Oct 19, 2024

Hey, thanks for this package.

I have a question on setting up a recurrent task.

I defined a current task as you did in the README and then ran the schedule_tasks management command.
However, all I get as output is:

Successfully scheduled 0 tasks to domain http://localhost:8080

Is there additional setup required for registering the task?
(I briefly parsed the source code but thought it may be more efficient to ask directly)

Also, what should the value of DJANGO_CLOUD_TASKS_ENDPOINT be? Just the URL of my deployment?

@joaodaher
Copy link
Contributor

Is there additional setup required for registering the task?

You must be sure that the code where your task lives in are imported during Django setup, pretty much like Django signals require you to import them.

I usually import them in the app's setup. Here's an example.

what should the value of DJANGO_CLOUD_TASKS_ENDPOINT be? Just the URL of my deployment?

Yes!
The URL that Google Cloud Tasks will call to invoke a task.

If you're using Cloud Run, it can be the service URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants