I have develop a django apps, and i start the server by using python manage.py runserver. without stop the server and without edit any code I wish it reload the server after 24 hoursy, any ideas on this?
Asked
Active
Viewed 285 times
2 Answers
0
You can use Cron for this.
From Wikipedia:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command to execute

schillingt
- 13,493
- 2
- 32
- 34
-
But my machine is window server – Shi Jie Tio Feb 20 '20 at 03:36
-
Here's a question that should be helpful. https://stackoverflow.com/questions/7195503/setting-up-a-cron-job-in-windows – schillingt Feb 20 '20 at 14:08
0
Does it automatically reload when you edit one of its source files, like it does on Linux?
In that case, arrange for something to execute periodically, that "edits" a source file. Almost certainly, open for write and close is sufficient. On linux, touch file.py
causes a restart. As a last resort create a Python file that is imported by your project, containing a function that you don't actually use. To restart, replace it with a copy of itself.

nigel222
- 7,582
- 1
- 14
- 22