简体   繁体   中英

Django Celery create only one task, not periodic

I am testing django_celery and could not be happier. Really easy to set up and does a lot of stuff I want.

I have some tasks that I want to run just when the user wants, not periodically. To do this I created some django actions so when the user selects items in an app and selects the action I fire up some tasks. This is working fine but I also would like to have an admin page when the user can create new tasks (by demand, no scheduling) from the existing tasks on tasks.py

Is there an existing solution for these problem?

Thanks!

You could create your own admin or extend the current one to support what you want.

Give your tests names and create a model that stores the name and the arguments to use. Then you can have a link/button that runs the task on demand.

Or, you could use a Django Form to enter custom arguments each time rather than storing them in a database model.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM