This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A python script which starts celery worker and auto reload it when any code change happens. | |
I did this because Celery worker's "--autoreload" option seems not working for a lot of people. | |
''' | |
import time | |
from watchdog.observers import Observer ##pip install watchdog | |
from watchdog.events import PatternMatchingEventHandler | |
import psutil ##pip install psutil | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
LOGS_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'logs') | |
LOGGING = { | |
'version': 1, | |
'dusable_existing_loggers': True, | |
'formatters': { | |
'normal': { | |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |