|
@@ -1,12 +1,14 @@
|
1
|
1
|
import os
|
2
|
|
-
|
|
2
|
+import environ
|
3
|
3
|
import oscar
|
4
|
4
|
|
|
5
|
+env = environ.Env()
|
|
6
|
+
|
5
|
7
|
# Path helper
|
6
|
8
|
location = lambda x: os.path.join(
|
7
|
9
|
os.path.dirname(os.path.realpath(__file__)), x)
|
8
|
10
|
|
9
|
|
-DEBUG = os.environ.get('DEBUG', 'true') != 'false'
|
|
11
|
+DEBUG = env.bool('DEBUG', default=True)
|
10
|
12
|
SQL_DEBUG = DEBUG
|
11
|
13
|
|
12
|
14
|
ALLOWED_HOSTS = [
|
|
@@ -39,11 +41,10 @@ DATABASES = {
|
39
|
41
|
}
|
40
|
42
|
|
41
|
43
|
CACHES = {
|
42
|
|
- 'default': {
|
43
|
|
- 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
44
|
|
- }
|
|
44
|
+ 'default': env.cache(default='locmemcache://'),
|
45
|
45
|
}
|
46
|
46
|
|
|
47
|
+
|
47
|
48
|
# Local time zone for this installation. Choices can be found here:
|
48
|
49
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
49
|
50
|
# although not all choices may be available on all operating systems.
|
|
@@ -391,8 +392,8 @@ USE_LESS = False
|
391
|
392
|
# Sentry
|
392
|
393
|
# ======
|
393
|
394
|
|
394
|
|
-if os.environ.get('SENTRY_DSN'):
|
395
|
|
- RAVEN_CONFIG = {'dsn': os.environ.get('SENTRY_DSN')}
|
|
395
|
+if env('SENTRY_DSN', default=None):
|
|
396
|
+ RAVEN_CONFIG = {'dsn': env('SENTRY_DSN', default=None)}
|
396
|
397
|
LOGGING['handlers']['sentry'] = {
|
397
|
398
|
'level': 'ERROR',
|
398
|
399
|
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
|