settings.py 3.69 KB
Newer Older
1
"""
2
Django settings for roomlist project.
3
4

For more information on this file, see
5
https://docs.djangoproject.com/en/1.7/topics/settings/
6
7

For the full list of settings and their values, see
8
https://docs.djangoproject.com/en/1.7/ref/settings/
9
10
11
12
13
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
14

15
16
ORGANIZATION_EMAIL_DOMAIN = 'masonlive.gmu.edu'

17
18
19
TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
    os.path.join(BASE_DIR, 'housing/templates'),
20
    os.path.join(BASE_DIR, 'accounts/templates'),
21
22
)

23
24
25
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)
26
27
28
29
30
31
32
33
34
35

print TEMPLATE_DIRS

TEMPLATE_LOADERS = (

    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',

)

36
37
38
39
40
41
42
43
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request',
Jason D Yeomans's avatar
Jason D Yeomans committed
44
45
    'allauth.account.context_processors.account',
    'allauth.socialaccount.context_processors.socialaccount',
46
)
47
# Quick-start development settings - unsuitable for production
48
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
49

50
51
52
53
import config
DEBUG = config.DEBUG
TEMPLATE_DEBUG = config.TEMPLATE_DEBUG
ALLOWED_HOSTS = config.ALLOWED_HOSTS
54
55
56
57
58
59
60
61
62
63

# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
Jason D Yeomans's avatar
Jason D Yeomans committed
64
    'django.contrib.sites',
Daniel W Bond's avatar
Daniel W Bond committed
65
    # apps
66
    'api',
67
    'housing',
68
    'accounts',
Daniel W Bond's avatar
Daniel W Bond committed
69
    # packages
70
71
    'crispy_forms',
    'django_gravatar',
Jason D Yeomans's avatar
Jason D Yeomans committed
72
73
74
75
76
77
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.facebook',
    'allauth.socialaccount.providers.google',
    'allauth.socialaccount.providers.twitter',
78
    'allauth.socialaccount.providers.instagram',
79
80
)

81
82
CRISPY_TEMPLATE_PACK = 'bootstrap'

83
84
MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
85
    'django.contrib.sessions.middleware.SessionMiddleware',
86
    'django.contrib.auth.middleware.AuthenticationMiddleware',
Daniel W Bond's avatar
Daniel W Bond committed
87
    'cas.middleware.CASMiddleware',
88
89
90
    'django.middleware.doc.XViewMiddleware',

    'django.middleware.csrf.CsrfViewMiddleware',
91
92
93
94
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

95
ROOT_URLCONF = 'settings.urls'
96

97
WSGI_APPLICATION = 'settings.wsgi.application'
98

99
import secret
100
# Database
101
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
102

103
104
SECRET_KEY = secret.SECRET_KEY

105
106
107
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
108
109
110
111
112
        'NAME': secret.DB_NAME,
        'USER': secret.DB_USER,
        'PASSWORD': secret.DB_PASSWORD,
        'HOST': secret.DB_HOST,
        'PORT': secret.DB_PORT,
113
114
115
116
    }
}

# Internationalization
117
# https://docs.djangoproject.com/en/1.7/topics/i18n/
118
119
120

LANGUAGE_CODE = 'en-us'

121
TIME_ZONE = 'America/New_York'
122
123
124
125
126
127
128

USE_I18N = True

USE_L10N = True

USE_TZ = True

Daniel W Bond's avatar
Daniel W Bond committed
129
130
SITE_ID = 2

131
# Static files (CSS, JavaScript, Images)
132
# https://docs.djangoproject.com/en/1.7/howto/static-files/
133
134

STATIC_URL = '/static/'
135

136
137
ACCOUNT_ADAPTER = 'accounts.adapter.AccountAdapter'

Jason D Yeomans's avatar
Jason D Yeomans committed
138
AUTHENTICATION_BACKENDS = (
139
    'django.contrib.auth.backends.ModelBackend',
Daniel W Bond's avatar
Daniel W Bond committed
140
    'cas.backends.CASBackend',
Jason D Yeomans's avatar
Jason D Yeomans committed
141
)
142

Daniel W Bond's avatar
Daniel W Bond committed
143
CAS_SERVER_URL = 'https://login.gmu.edu'
144
145
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
146

147
148
149
CAS_RESPONSE_CALLBACKS = (
    'accounts.cas_callbacks.create_user',
)