From 096ec56b7c8196125530be8ba6e464aab1265e9d Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Sun, 3 May 2015 21:45:46 +0000 Subject: [PATCH] Added tasks app --- TODO.md | 2 ++ orchestra/conf/project_template/project_name/settings.py | 9 ++++----- orchestra/contrib/tasks/__init__.py | 3 ++- orchestra/templates/admin/orchestra/menu.html | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index f48ce942..0b9bde7f 100644 --- a/TODO.md +++ b/TODO.md @@ -378,3 +378,5 @@ Collecting lxml==3.3.5 (from -r re (line 22)) counter.apply_async(10, '/tmp/kakas') # standard django deployment pracices (run checks) +# setup main systemuser on post_migrate SystemUser +# Provide some fixtures with mocked data diff --git a/orchestra/conf/project_template/project_name/settings.py b/orchestra/conf/project_template/project_name/settings.py index fc64a9be..0d239ea6 100644 --- a/orchestra/conf/project_template/project_name/settings.py +++ b/orchestra/conf/project_template/project_name/settings.py @@ -126,15 +126,14 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - 'USER': 'orchestra', # Not used with sqlite3. - 'PASSWORD': 'orchestra', # Not used with sqlite3. - 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. + 'CONN_MAX_AGE': 60*10 # Enable persistent connections } } -# Enable persistent connections -CONN_MAX_AGE = 60*10 # Internationalization # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/ diff --git a/orchestra/contrib/tasks/__init__.py b/orchestra/contrib/tasks/__init__.py index ce00dae0..cd37bd5e 100644 --- a/orchestra/contrib/tasks/__init__.py +++ b/orchestra/contrib/tasks/__init__.py @@ -57,6 +57,7 @@ def apply_async(fn, name=None, method='thread'): # Celery API compat thread.request = AttrDict(id=task_id) return thread + if name is None: name = get_name(fn) if method == 'thread': @@ -64,7 +65,7 @@ def apply_async(fn, name=None, method='thread'): elif method == 'process': method = Process else: - raise NotImplementedError("Support for %s concurrency method is not supported." % method) + raise NotImplementedError("%s concurrency method is not supported." % method) fn.apply_async = partial(inner, close_connection(keep_state(fn)), name, method) fn.delay = fn.apply_async return fn diff --git a/orchestra/templates/admin/orchestra/menu.html b/orchestra/templates/admin/orchestra/menu.html index 7a6ca971..d6c1ad59 100644 --- a/orchestra/templates/admin/orchestra/menu.html +++ b/orchestra/templates/admin/orchestra/menu.html @@ -46,7 +46,7 @@ {% endif %}