Search code examples
pythondjangoherokuschedule

Can I run a django view function automatically?


Is this possible to run a django view function automatically daily after deploying it on heroku.?

I mean.. I have a database where I have datefield. I have a view function, which matches that date with today's date and sends an email. Is it possible..that view function runs daily automatically and matches the dates and does the task.??


Solution

  • APScheduler can be used for this. You set schedules to call functions and set how often you'd like each formula triggered. I've used this on Heroku and it definitely works.

    https://pypi.org/project/django-apscheduler/