# Hack to clean up if versions of plugins specified exploded = re.split(r'[<>=]+', plugin) CABOT_PLUGINS_ENABLED_PARSED.append(exploded[0]) INSTALLED_APPS += tuple(CABOT_PLUGINS_ENABLED_PARSED) COMPRESS_PRECOMPILERS = ( ('text/coffeescript', 'coffee --compile --stdio'), ('text/eco', 'eco -i TEMPLATES {infile} && cat "$(echo "{infile}" | sed -e "s/\.eco$/.js/g")"' ), ('text/less', 'lessc {infile} > {outfile}'), ) # For the email settings we both accept old and new names EMAIL_HOST = environ_get_list(['EMAIL_HOST', 'SES_HOST'], 'localhost') EMAIL_PORT = int(environ_get_list(['EMAIL_PORT', 'SES_PORT'], 25)) EMAIL_HOST_USER = environ_get_list(['EMAIL_USER', 'SES_USER'], '') EMAIL_HOST_PASSWORD = environ_get_list(['EMAIL_PASSWORD', 'SES_PASS'], '') EMAIL_BACKEND = environ_get_list(['EMAIL_BACKEND', 'SES_BACKEND'], 'django.core.mail.backends.smtp.EmailBackend') EMAIL_USE_TLS = force_bool( environ_get_list(['EMAIL_USE_TLS', 'SES_USE_TLS'], False)) EMAIL_USE_SSL = force_bool( environ_get_list(['EMAIL_USE_SSL', 'SES_USE_SSL'], not EMAIL_USE_TLS)) COMPRESS_OFFLINE = not DEBUG RECOVERY_SNIPPETS_WHITELIST = ( r'https?://[^.]+\.hackpad\.com/[^./]+\.js', r'https?://gist\.github\.com/[^.]+\.js',
import os from datetime import timedelta from cabot.settings_utils import environ_get_list BROKER_URL = environ_get_list(['CELERY_BROKER_URL', 'CACHE_URL']) # Set environment variable if you want to run tests without a redis instance CELERY_ALWAYS_EAGER = os.environ.get('CELERY_ALWAYS_EAGER', False) CELERY_RESULT_BACKEND = os.environ.get('CELERY_RESULT_BACKEND', None) CELERY_IMPORTS = ('cabot.cabotapp.tasks', ) CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' CELERY_TASK_SERIALIZER = 'json' CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml'] CELERYD_TASK_SOFT_TIME_LIMIT = 120 CELERYD_TASK_TIME_LIMIT = 150 CELERYBEAT_SCHEDULE = { 'run-all-checks': { 'task': 'cabot.cabotapp.tasks.run_all_checks', 'schedule': timedelta(seconds=60), }, 'update-shifts': { 'task': 'cabot.cabotapp.tasks.update_shifts', 'schedule': timedelta(seconds=1800), }, 'clean-db': { 'task': 'cabot.cabotapp.tasks.clean_db', 'schedule': timedelta(seconds=60 * 60 * 24), }, } CELERY_TIMEZONE = 'UTC'
import os from cabot.settings_utils import environ_get_list broker_url = environ_get_list(['CELERY_BROKER_URL', 'CACHE_URL']) # Set environment variable if you want to run tests without a redis instance task_always_eager = environ_get_list(['CELERY_ALWAYS_EAGER', 'CELERY_TASK_ALWAYS_EAGER'], False) backend = os.environ.get('CELERY_RESULT_BACKEND', None) timezone = 'UTC'
import os from cabot.settings_utils import environ_get_list broker_url = environ_get_list(['CELERY_BROKER_URL', 'CACHE_URL']) # Set environment variable if you want to run tests without a redis instance task_always_eager = environ_get_list( ['CELERY_ALWAYS_EAGER', 'CELERY_TASK_ALWAYS_EAGER'], False) backend = os.environ.get('CELERY_RESULT_BACKEND', None) timezone = 'UTC'
for plugin in CABOT_PLUGINS_ENABLED.split(","): # Hack to clean up if versions of plugins specified exploded = re.split(r'[<>=]+', plugin) CABOT_PLUGINS_ENABLED_PARSED.append(exploded[0]) INSTALLED_APPS += tuple(CABOT_PLUGINS_ENABLED_PARSED) COMPRESS_PRECOMPILERS = ( ('text/coffeescript', 'coffee --compile --stdio'), ('text/eco', 'eco -i TEMPLATES {infile} && cat "$(echo "{infile}" | sed -e "s/\.eco$/.js/g")"'), ('text/less', 'lessc {infile} > {outfile}'), ) # For the email settings we both accept old and new names EMAIL_HOST = environ_get_list(['EMAIL_HOST', 'SES_HOST'], 'localhost') EMAIL_PORT = int(environ_get_list(['EMAIL_PORT', 'SES_PORT'], 25)) EMAIL_HOST_USER = environ_get_list(['EMAIL_USER', 'SES_USER'], '') EMAIL_HOST_PASSWORD = environ_get_list(['EMAIL_PASSWORD', 'SES_PASS'], '') EMAIL_BACKEND = environ_get_list( ['EMAIL_BACKEND', 'SES_BACKEND'], 'django.core.mail.backends.smtp.EmailBackend' ) EMAIL_USE_TLS = force_bool(environ_get_list(['EMAIL_USE_TLS', 'SES_USE_TLS'], False)) EMAIL_USE_SSL = force_bool(environ_get_list(['EMAIL_USE_SSL', 'SES_USE_SSL'], not EMAIL_USE_TLS)) COMPRESS_OFFLINE = not DEBUG RECOVERY_SNIPPETS_WHITELIST = ( r'https?://[^.]+\.hackpad\.com/[^./]+\.js', r'https?://gist\.github\.com/[^.]+\.js',