Skip to content

Instantly share code, notes, and snippets.

@chenjianjx
chenjianjx / start-celery-for-dev.py
Created March 10, 2016 10:45
A python script which starts celery worker and auto reload it when any code change happens.
'''
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
@chenjianjx
chenjianjx / loggers.py
Created March 8, 2016 09:55 — forked from jarvys/loggers.py
logging configuration for django
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'