summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-08-02 13:49:55 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-08-02 13:49:55 +0200
commit479eb07ee0d7c0b1b6d7677d558033489842aa91 (patch)
treef253099f74824d61fbbcfd08d7c1edbf88395870
parent0e5abeb934c23609da0c4cf9a03649421b043015 (diff)
downloadChimère - projet de référence-479eb07ee0d7c0b1b6d7677d558033489842aa91.tar.bz2
Chimère - projet de référence-479eb07ee0d7c0b1b6d7677d558033489842aa91.zip
Make Celery and Kombu optional (but the import is not available)
-rw-r--r--settings.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/settings.py b/settings.py
index e0975e1..29c7823 100644
--- a/settings.py
+++ b/settings.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# Don't edit this file:
# overload all theses settings in your local_settings.py file
import os
@@ -90,11 +91,6 @@ DATABASES = {
},
}
-# celery
-import djcelery
-djcelery.setup_loader()
-BROKER_URL = 'django://'
-
# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
@@ -164,7 +160,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.request",
)
-INSTALLED_APPS = (
+INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
@@ -172,13 +168,30 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.gis',
'django.contrib.staticfiles',
- 'kombu.transport.django',
- 'djcelery',
'south',
'chimere',
# activate it if you want to use old migration scripts
#'chimere.scripts',
-)
+]
+
+# celery
+try:
+ import djceleryaaaaaa
+ import kombu
+ djcelery.setup_loader()
+ BROKER_URL = 'django://'
+ INSTALLED_APPS += ['kombu.transport.django',
+ 'djcelery']
+except ImportError:
+ # some import and export will not be available
+ pass
+
+INSTALLED_APPS += [
+ 'south',
+ 'chimere',
+ # activate it if you want to use old migration scripts
+ #'chimere.scripts',
+]
LOGGING = {'version': 1,
'disable_existing_loggers': False,