From: Radek Czajka Date: Wed, 23 Apr 2014 14:39:08 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/production' X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/2d0cc46d3bc3357c19d13fc585c0a9492e5ee1b7?hp=6c78d4b8976e413f788ab3db1dc899608b70c7f3 Merge remote-tracking branch 'origin/production' --- diff --git a/apps/api/management/commands/mobileinit.py b/apps/api/management/commands/mobileinit.py index 2102bbb9c..3d88a7744 100755 --- a/apps/api/management/commands/mobileinit.py +++ b/apps/api/management/commands/mobileinit.py @@ -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 diff --git a/lib/librarian b/lib/librarian index ccc0df182..13b88a3bf 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit ccc0df182c479eb554148e5bbc3fd9f6bec95e20 +Subproject commit 13b88a3bfdd4fa3cf5c92368aa5cb60fa832eda6 diff --git a/requirements.txt b/requirements.txt index f630b15e9..1b6930ab5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/wolnelektury-celery.conf.template b/wolnelektury-celery.conf.template index 4d45ec70e..d36a08a8f 100644 --- a/wolnelektury-celery.conf.template +++ b/wolnelektury-celery.conf.template @@ -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 diff --git a/wolnelektury/__init__.py b/wolnelektury/__init__.py index e69de29bb..cf2e85f6d 100644 --- a/wolnelektury/__init__.py +++ b/wolnelektury/__init__.py @@ -0,0 +1 @@ +from .celery import app as celery_app diff --git a/wolnelektury/celery.py b/wolnelektury/celery.py new file mode 100644 index 000000000..ae5ce20ce --- /dev/null +++ b/wolnelektury/celery.py @@ -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) diff --git a/wolnelektury/settings/__init__.py b/wolnelektury/settings/__init__.py index c40bb366b..bce9bd399 100644 --- a/wolnelektury/settings/__init__.py +++ b/wolnelektury/settings/__init__.py @@ -90,7 +90,7 @@ INSTALLED_APPS_CONTRIB = [ 'south', 'sorl.thumbnail', 'djcelery', - 'djkombu', + 'kombu.transport.django', 'honeypot', #'django_nose', 'fnpdjango', diff --git a/wolnelektury/settings/celery.py b/wolnelektury/settings/celery.py index ad37707ee..e4286ce65 100644 --- a/wolnelektury/settings/celery.py +++ b/wolnelektury/settings/celery.py @@ -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'] diff --git a/wolnelektury/settings/static.py b/wolnelektury/settings/static.py index 2bfcd259b..7ea3d70e5 100644 --- a/wolnelektury/settings/static.py +++ b/wolnelektury/settings/static.py @@ -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 diff --git a/wolnelektury/utils.py b/wolnelektury/utils.py index e06fb1d87..0c256e5df 100644 --- a/wolnelektury/utils.py +++ b/wolnelektury/utils.py @@ -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