diff options
| 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 | 
| commit | 8efe88a9e4cea5f97ccf71e62234ab75ef9fd3ee (patch) | |
| tree | 2f01a2d5360feb11ceae41c979df5ecc01770441 /example_project/settings.py | |
| parent | db6c38b03dd71df6ab6a22bed19035cd964e0b20 (diff) | |
| download | Chimère-8efe88a9e4cea5f97ccf71e62234ab75ef9fd3ee.tar.bz2 Chimère-8efe88a9e4cea5f97ccf71e62234ab75ef9fd3ee.zip  | |
Make Celery and Kombu optional (but the import is not available)
Diffstat (limited to 'example_project/settings.py')
| -rw-r--r-- | example_project/settings.py | 31 | 
1 files changed, 22 insertions, 9 deletions
diff --git a/example_project/settings.py b/example_project/settings.py index e0975e1..29c7823 100644 --- a/example_project/settings.py +++ b/example_project/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,  | 
