Can I have some code constantly run inside Django like a daemon

前端 未结 3 762
遥遥无期
遥遥无期 2021-02-04 05:10

I\'m using mod_wsgi to serve a django site through Apache. I also have some Python code that runs as a background process (dameon?). It keeps polling a server and inserts data i

3条回答
  •  故里飘歌
    2021-02-04 05:58

    You could either set up a cron job that runs some function you have defined, or - the more advanced and probably recommended method, integrate celery in your project (which is quite easy, actually).

提交回复
热议问题