-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathsettings.py
More file actions
114 lines (96 loc) · 3.06 KB
/
settings.py
File metadata and controls
114 lines (96 loc) · 3.06 KB
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
import os
from django.utils._os import safe_join
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = os.environ['ENV'] == 'DEV'
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['python.ph', 'localhost', '*']
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Third-party
'taggit',
'tastypie',
'compressor',
'raven.contrib.django.raven_compat',
'markdownx',
'ckeditor',
# pythonph
'landing',
'registration',
'jobs',
'slack',
'common',
'organisation',
)
MIDDLEWARE = (
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', # Keep this here as stated on docs
'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 = 'pythonph.urls'
WSGI_APPLICATION = 'pythonph.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': os.environ.get('POSTGRES_HOST', 'localhost'),
'NAME': os.environ['POSTGRES_USER'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ['POSTGRES_PASSWORD'],
},
}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Manila'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_ROOT = safe_join(BASE_DIR, 'static')
MEDIA_ROOT = safe_join(BASE_DIR, 'media')
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
LOGIN_URL = "login"
LOGIN_REDIRECT_URL = "landing"
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = not DEBUG
COMPRESS_OUTPUT_DIR = 'cache'
TASTYPIE_DEFAULT_FORMATS = ['json']
if 'SENTRY_DSN' in os.environ:
RAVEN_CONFIG = {
'dsn': os.environ['SENTRY_DSN'],
}
if DEBUG:
INSTALLED_APPS += ('debug_toolbar',)
SLACK_ORG = os.environ['SLACK_ORG']
SLACK_API_TOKEN = os.environ['SLACK_API_TOKEN']
SLACK_BOARD_CHANNEL = os.environ['SLACK_BOARD_CHANNEL']
SLACK_JOBS_CHANNEL = os.environ['SLACK_JOBS_CHANNEL']
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/'