Merge remote-tracking branch 'origin/production'
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 23 Apr 2014 14:39:08 +0000 (16:39 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 23 Apr 2014 14:39:08 +0000 (16:39 +0200)
apps/api/management/commands/mobileinit.py
lib/librarian
requirements.txt
wolnelektury-celery.conf.template
wolnelektury/__init__.py
wolnelektury/celery.py [new file with mode: 0644]
wolnelektury/settings/__init__.py
wolnelektury/settings/celery.py
wolnelektury/settings/static.py
wolnelektury/utils.py

index 2102bbb..3d88a77 100755 (executable)
@@ -159,8 +159,7 @@ def add_book(db, book):
 
 def add_tag(db, tag):
     id = tag.id
-    #    category = categories[tag.category] # localized names here?
-    category = tag.category
+    category = categories[tag.category]
     name = tag.name
     sort_key = tag.sort_key
 
index ccc0df1..13b88a3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ccc0df182c479eb554148e5bbc3fd9f6bec95e20
+Subproject commit 13b88a3bfdd4fa3cf5c92368aa5cb60fa832eda6
index f630b15..1b6930a 100644 (file)
@@ -12,7 +12,7 @@ django-piston>=0.2.2.1,<0.2.3
 jsonfield>=0.9.20
 django-picklefield
 django-modeltranslation
-django-allauth>=0.15,<0.16
+django-allauth>=0.16,<0.17
 
 pytz
 
@@ -29,8 +29,7 @@ python-fb
 # Feedparser 
 Feedparser>=5.1
 
-# PIL 
-PIL>=1.1.6
+Pillow
 mutagen>=1.17
 sorl-thumbnail>=11.09,<12
 
@@ -41,8 +40,7 @@ lxml>=2.2.2
 # MySQL-python>=1.2,<2.0
 
 # celery tasks
-django-celery>=3.0.11,<3.1
-django-kombu
+django-celery>=3.1,<3.2
 
 # spell checking
 pyenchant
@@ -53,4 +51,4 @@ pyoai
 ## egenix-mx-base  # Doesn't play nice with mx in dist-packages.
 sunburnt
 
-django-getpaid>=1.4,<1.5
+django-getpaid>=1.6,<1.7
index 4d45ec7..d36a08a 100644 (file)
@@ -4,7 +4,7 @@
 ; =========================================
 
 [program:celery.%(project_name)s]
-command=%(path)s/ve/bin/python %(path)s/releases/current/manage.py celeryd --loglevel=INFO
+command=%(path)s/ve/bin/celery -A wolnelektury worker -l info
 directory=%(path)s/releases/current/
 user=%(user)s
 numprocs=2
index e69de29..cf2e85f 100644 (file)
@@ -0,0 +1 @@
+from .celery import app as celery_app
diff --git a/wolnelektury/celery.py b/wolnelektury/celery.py
new file mode 100644 (file)
index 0000000..ae5ce20
--- /dev/null
@@ -0,0 +1,21 @@
+from __future__ import absolute_import
+
+import os
+import sys
+
+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path = [
+    os.path.join(ROOT, 'apps'),
+    os.path.join(ROOT, 'lib'),
+    os.path.join(ROOT, 'lib/librarian'),
+] + sys.path
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wolnelektury.settings')
+
+from celery import Celery
+from django.conf import settings
+
+app = Celery('wolnelektury')
+
+app.config_from_object('django.conf:settings')
+app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
index c40bb36..bce9bd3 100644 (file)
@@ -90,7 +90,7 @@ INSTALLED_APPS_CONTRIB = [
     'south',
     'sorl.thumbnail',
     'djcelery',
-    'djkombu',
+    'kombu.transport.django',
     'honeypot',
     #'django_nose',
     'fnpdjango',
index ad37707..e4286ce 100644 (file)
@@ -1,12 +1,6 @@
-import djcelery
-djcelery.setup_loader()
-
-BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
-BROKER_HOST = "localhost"
-BROKER_PORT = 5672
-BROKER_USER = "guest"
-BROKER_PASSWORD = "guest"
-BROKER_VHOST = "/"
+BROKER_URL = 'django://'
+CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'
 
 CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
 CELERY_SEND_TASK_ERROR_EMAILS = True
+CELERY_ACCEPT_CONTENT = ['pickle']
index 2bfcd25..7ea3d70 100644 (file)
@@ -140,7 +140,7 @@ PIPELINE_JS = {
 
 }
 
-STATICFILES_STORAGE = 'wolnelektury.utils.GzipPipelineCachedStorage'
+STATICFILES_STORAGE = 'fnpdjango.utils.pipeline_storage.GzipPipelineCachedStorage'
 PIPELINE_CSS_COMPRESSOR = None
 PIPELINE_JS_COMPRESSOR = None
 
index e06fb1d..0c256e5 100644 (file)
@@ -5,8 +5,6 @@
 import pytz
 from django.utils import timezone
 from django.conf import settings
-from pipeline.storage import GZIPMixin
-from pipeline.storage import PipelineCachedStorage
 
 tz = pytz.timezone(settings.TIME_ZONE)
 
@@ -17,6 +15,3 @@ def localtime_to_utc(localtime):
 
 def utc_for_js(dt):
     return dt.strftime('%Y/%m/%d %H:%M:%S UTC')
-
-class GzipPipelineCachedStorage(GZIPMixin, PipelineCachedStorage):
-    pass