Currently, I’m using a Django library named appscheduler.
job = scheduler.add_job(schedule_job, ‘cron’, day_of_week=‘mon-fri’, hour=14, minute=5)
When I run this cron job in my localhost it’s working very smoothly. But my Cpanel hosting not working. But in my Cpanel terminal if I run this code “python manage.py runserver” it is working until the terminal is open. When I close the terminal, it’s not working. The server opened into the terminal.
Another thing is that,
job = scheduler.add_job(schedule_job, ‘interval’, seconds=50)
This interval job is running fine into localhost and also cpnael (N.B without running terminal it’s working smoothly into Cpanel)
I couldn’t detect here why the first code is not working without Cpanel and why the second code is working fine without terminal.
Why Hosting django application in Cpanel is totally a bad idea:
Limited customization options: Cpanel has limited customization options for Django, making it difficult to tailor the hosting environment to meet the specific needs of a Django application.
Lack of scalability: Cpanel is not designed to handle the scalability requirements of a growing Django application, making it difficult to upgrade to higher resources as needed.
Complex configuration: Integrating Django with Cpanel requires significant technical expertise, making it challenging for non-technical users.
Limited control over server configuration: Cpanel provides limited options for customizing server configurations, which may not be suitable for Django applications that require specific needs.
Any solution for such things? I just need to solve the cron job run into hosting. Others are working well. Even 'Interval" is also good at it.