/
common.py
144 lines (97 loc) · 3.47 KB
/
common.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
"""
Django settings for qtile.org.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import datetime
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
PROJECT_DIR = os.sep.join((os.path.abspath(__file__).split(os.sep))[:-2])
BASE_DIR = os.path.dirname(PROJECT_DIR)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ln-=_^uq_8_5qf3fi^00y(lckyz(d31h^o!8m+f_+#xo=w7!u^'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(int(os.environ.get('DJANGO_DEBUG', 1)))
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
ALLOWED_INCLUDE_ROOTS = [
os.path.join(PROJECT_DIR, 'includes')
]
# Application definition
INSTALLED_APPS = [
'django.contrib.staticfiles',
'qtile',
'compressor',
'django_pygments',
'jsonify',
'raven.contrib.django.raven_compat',
]
MIDDLEWARE_CLASSES = [
# 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'qtile.urls'
WSGI_APPLICATION = 'qtile.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {}
# Cache
# https://docs.djangoproject.com/en/1.6/ref/settings/#caches
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(PROJECT_DIR, 'static'),
]
# if 'collectstatic' not in sys.argv:
STATICFILES_DIRS.append(os.path.join(BASE_DIR, 'public/bower_components'))
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'public/static')
# django-compressor
# http://django-compressor.readthedocs.org
COMPRESS_ENABLED = False
COMPRESS_OFFLINE = True
COMPRESS_PRECOMPILERS = (
('text/less', 'lessc -x {infile} {outfile}'),
)
# Templating
TEMPLATE_DIRS = (os.path.join(PROJECT_DIR, 'templates'),)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.debug',
'django.core.context_processors.request',
'django.core.context_processors.static',
'qtile.context_processors.context',
)
# Qtile Stuff
QTILE_VERSION = os.environ.get('QTILE_VERSION', '0.9.1')
QTILE_DOWNLOAD = os.environ.get('QTILE_DOWNLOAD',
'https://github.com/qtile/qtile/archive/v{0}.tar.gz'.format(QTILE_VERSION))
QTILE_RELEASE_DATE = datetime.datetime.strptime(
os.environ.get('QTILE_RELEASE_DATE', '2015-02-13'), '%Y-%m-%d').date()
# Google Analytics Tracking ID
GOOGLE_ANALYTICS_ID = os.environ.get('GOOGLE_ANALYTICS_ID')