Skip to content

Commit

Permalink
* Make cerly happy. These few line changes took way to long....
Browse files Browse the repository at this point in the history
  • Loading branch information
bgroff committed Jul 10, 2018
1 parent dfee936 commit bb47de4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
4 changes: 3 additions & 1 deletion django_kala/django_kala/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import absolute_import
from __future__ import absolute_import, unicode_literals

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app

__all__ = ['celery_app']
18 changes: 9 additions & 9 deletions django_kala/django_kala/celery.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from __future__ import absolute_import

from __future__ import absolute_import, unicode_literals
import os

from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_kala.settings')

from django.conf import settings # noqa
app = Celery('kala')

app = Celery('django_kala')

# Using a string here means the worker will not have to
# pickle the object when using Windows.
# 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')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()
2 changes: 1 addition & 1 deletion django_kala/django_kala/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'es'
LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

Expand Down
4 changes: 2 additions & 2 deletions django_kala/projects/tasks/export_document.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from celery.task import Task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.crypto import get_random_string

from documents.models import Document
from projects.models import Export

import celery
import os
import requests
import tempfile
Expand All @@ -14,7 +14,7 @@
User = get_user_model()


class ExportDocumentTask(celery.Task):
class ExportDocumentTask(Task):

def run(self, *args, **kwargs):
document = Document.objects.get(pk=args[0])
Expand Down
4 changes: 2 additions & 2 deletions django_kala/projects/tasks/export_project.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from celery.task import Task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.crypto import get_random_string

from projects.models import Project, Export

import celery
import os
import requests
import tempfile
Expand All @@ -13,7 +13,7 @@
User = get_user_model()


class ExportProjectTask(celery.Task):
class ExportProjectTask(Task):

def run(self, *args, **kwargs):
project = Project.objects.get(pk=args[0])
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ djangorestframework
packaging
pillow
psycopg2
pycurl
pyparsing
pytz
ipython
Expand Down

0 comments on commit bb47de4

Please sign in to comment.