我如何最好地运行每日脚本,该脚本在数字海洋应用程序平台中使用外部URL的内容更新我的Django应用程序?
我在数字海洋应用程序平台上设置了Django Web应用程序。我想每天更新我的Django应用程序,其中包括来自外部URL的内容。不幸的是,APP平台中没有CRON作业。
具体来说,我想从外部URL获取图像,尝试下载图像,并在下载成功(如果下载成功)中在我的Django应用中进行更新。
I have a Django Web App set up on the Digital Ocean App Platform. I want to update my Django App daily with content from external URLs. Unfortunately, cron jobs are not available in the App Platform.
Specifically, I want to fetch images from external URLs, attempt to download the images, and update it in my Django App if the download was successful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以考虑配置芹菜并将芹菜节拍用于django,在不需要Cronjob的情况下,您有许多配置计划任务的选项。
文档在这里
daemonize芹菜
您将如何使用芹菜节拍的示例:
You can consider configuring celery and using celery beat for django, there you have many options configuring scheduled tasks without the need of a cronjob.
Documentation here
Daemonize Celery here
Example of how you would use celery beat: