
from __future__ import absolute_import, unicode_literals

import os
import sys
from unipath import Path
from celery import Celery

BASE_DIR = Path(os.path.abspath(__file__)).ancestor(2)

sys.path.insert(0, BASE_DIR)
sys.path.insert(0, BASE_DIR.child("lib"))
sys.path.insert(0, '/usr/local/src/booktype/lib')

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'instance1_site.settings.dev')

app = Celery('celery_booktype')

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()
    