Cron jobs with Django
What is the way to setup cron jobs with django on railway? I tried the usual way of dockerizing my app but docker compose isnt supported on railway. What other options do I have?
(Newbie here, came from using heroku scheduler)
7 Replies
Please provide your project ID or reply with
N/A
. Thread will automatically be closed if no reply is received within 10 minutes. You can copy your project's id by pressing Ctrl/Cmd + K -> Copy Project ID.You might find these helpful:
- Cron Jobs on Railway
- How to set up Python Cron job
- Python Telegram Bot Scheduled Deployment
⚠️ experimental feature
No project ID was provided. Closing thread.
be4c5d11-a107-4bc2-b215-df55f2e73277
would recommend APScheduler, you can use cron expressions if you would like
you can just add it as a dependency alongside django, in my repo i have a
config.py
file that lays out the configuration for gunicorn and also has some cron jobs in it
thanks for the reply
can i set management commands as the cron job function?
hmmmmmmmm that might get tricky if you're talking about python manage.py commands
you could try just calling them via the shell with os.sys but beware of conflicts with the db and stuff if it's in use by the application at the time