Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ 8bcb3f57

History | View | Annotate | Download (7.2 kB)

1
# Django settings for eduroam project.
2
import os
3

    
4
DEBUG = True
5
TEMPLATE_DEBUG = DEBUG
6
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
7

    
8
ADMINS = (
9
     ('Admin', 'admin@example.com'),
10
)
11

    
12
MANAGERS = ADMINS
13

    
14
DATABASES = {
15
    'default': {
16
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
17
        'NAME': '',                      # Or path to database file if using sqlite3.
18
        'USER': '',                      # Not used with sqlite3.
19
        'PASSWORD': '',                  # Not used with sqlite3.
20
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
21
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
22
        'STORAGE_ENGINE': 'INNODB',        
23
    }
24
}
25

    
26
# Local time zone for this installation. Choices can be found here:
27
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
28
# although not all choices may be available on all operating systems.
29
# On Unix systems, a value of None will cause Django to use the same
30
# timezone as the operating system.
31
# If running in a Windows environment this must be set to the same as your
32
# system time zone.
33
TIME_ZONE = 'Europe/Athens'
34

    
35

    
36
_ = lambda s: s
37

    
38
LANGUAGES = (
39
    ('el', _('Greek')),
40
    ('en', _('English')),
41
)
42

    
43
# Language code for this installation. All choices can be found here:
44
# http://www.i18nguy.com/unicode/language-identifiers.html
45
LANGUAGE_CODE = 'en'
46

    
47
SITE_ID = 1
48

    
49
# If you set this to False, Django will make some optimizations so as not
50
# to load the internationalization machinery.
51
USE_I18N = True
52

    
53
# If you set this to False, Django will not format dates, numbers and
54
# calendars according to the current locale
55
USE_L10N = True
56

    
57
# Absolute path to the directory that holds media.
58
# Example: "/home/media/media.lawrence.com/"
59
MEDIA_ROOT = ''
60

    
61
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
62
# trailing slash if there is a path component (optional in other cases).
63
# Examples: "http://media.lawrence.com", "http://example.com/media/"
64
MEDIA_URL = ''
65

    
66
STATIC_URL = '/example/static'
67

    
68
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
69
# trailing slash.
70
# Examples: "http://foo.com/media/", "/media/".
71
ADMIN_MEDIA_PREFIX = '/media/'
72

    
73
# Make this unique, and don't share it with anybody.
74
SECRET_KEY = 'x)gmuyo2h=l@tmpyh4b(-!gki%@u$-=3^@z+vf&&!ci7$*!+k9'
75

    
76

    
77
AUTHENTICATION_BACKENDS = (
78
    'eduroam.djangobackends.shibauthBackend.shibauthBackend',    
79
    'eduroam.djangobackends.ldapBackend.ldapBackend',    
80
    'social_auth.backends.twitter.TwitterBackend',
81
    #'social_auth.backends.facebook.FacebookBackend',
82
    'social_auth.backends.google.GoogleBackend',
83
    #'social_auth.backends.contrib.linkedin.LinkedinBackend',
84
    #'social_auth.backends.contrib.yahoo.YahooOAuthBackend',
85
    #'social_auth.backends.yahoo.YahooBackend',
86
    'social_auth.backends.OpenIDBackend',
87
	'django.contrib.auth.backends.ModelBackend',
88
)
89

    
90

    
91
# List of callables that know how to import templates from various sources.
92
TEMPLATE_LOADERS = (
93
    'django.template.loaders.filesystem.Loader',
94
    'django.template.loaders.app_directories.Loader',
95
#     'django.template.loaders.eggs.Loader',
96
)
97

    
98
TEMPLATE_CONTEXT_PROCESSORS = (
99
    # Required so that RequestContext is passed into
100
    # template
101
    'django.core.context_processors.auth',
102
    'django.core.context_processors.debug',
103
    'django.core.context_processors.i18n',
104
    'django.core.context_processors.media',
105
    'django.core.context_processors.request',
106
    'social_auth.context_processors.social_auth_by_type_backends',
107
)
108

    
109
MIDDLEWARE_CLASSES = (
110
    'django.middleware.cache.UpdateCacheMiddleware',
111
    'django.middleware.gzip.GZipMiddleware',
112
    'django.middleware.common.CommonMiddleware',
113
    'django.contrib.sessions.middleware.SessionMiddleware',
114
    'django.middleware.locale.LocaleMiddleware',
115
    'django.middleware.csrf.CsrfViewMiddleware',
116
    'django.contrib.auth.middleware.AuthenticationMiddleware',
117
    'django.contrib.messages.middleware.MessageMiddleware',
118
    'django.middleware.cache.FetchFromCacheMiddleware',
119
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
120
)
121

    
122
ROOT_URLCONF = 'eduroam.urls'
123

    
124
TEMPLATE_DIRS = (
125
    "/example/templates"
126
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
127
    # Always use forward slashes, even on Windows.
128
    # Don't forget to use absolute paths, not relative paths.
129
)
130

    
131
INSTALLED_APPS = (
132
    'longerusername',
133
    'django.contrib.auth',
134
    'django.contrib.contenttypes',
135
    'django.contrib.sessions',
136
    'django.contrib.sites',
137
    'django.contrib.messages',
138
    'django.contrib.flatpages',
139
    'django.contrib.markup',
140
    'django.contrib.admin',
141
    'django.contrib.admindocs',
142
    'edumanage',
143
    'accounts',
144
    'south',
145
    'registration',
146
    'django_extensions',
147
    'tinymce',
148
    'social_auth',
149
    
150
)
151

    
152
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
153

    
154
LOGIN_URL = '/login/'
155

    
156
KML_FILE = here('all.kml')
157
INST_XML_FILE = here('institution.xml')
158

    
159
EDUROAM_KML_URL = 'http://monitor.eduroam.org/kml/all.kml'
160

    
161
SHIB_AUTH_ENTITLEMENT = 'urn:mace:grnet.gr:eduroam:admin'
162
SHIB_LOGOUT_URL = 'https://netdev.grnet.gr/Shibboleth.sso/Logout'
163

    
164
SERVER_EMAIL = "GRNET eduroam Service <noreply@grnet.gr>"
165
EMAIL_SUBJECT_PREFIX = "[eduroam] "
166
ACCOUNT_ACTIVATION_DAYS = 7
167
NOTIFY_ADMIN_MAILS = ["mail1@example.com", "mail2@example.com"]
168

    
169

    
170
TINYMCE_JS_URL = '/static/js/tinymce/tiny_mce.js'
171

    
172
TINYMCE_DEFAULT_CONFIG = {
173
    'extended_valid_elements' :  'iframe[src|width|height|name|align]',
174
    'plugins': "table,spellchecker,paste,searchreplace",
175
    'theme': "advanced",
176
}
177

    
178
CACHE_BACKEND = 'memcached://127.0.0.1:11211/?timeout=5184000'
179

    
180
# Overview LDAP
181
LDAP_AUTH_SETTINGS = (
182
    {'url': 'ldap://ds.example.com',   'base': 'dc=dept,dc=example,dc=com'},
183
)
184
# If defined as a string new users will belong in this group. Group must exist
185
LDAP_AUTH_GROUP = None
186
# Whether new users will have admin access
187
LDAP_AUTH_IS_STAFF = False
188

    
189
#Shibboleth attribute map
190
SHIB_USERNAME = ['HTTP_EPPN']
191
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
192
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
193
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
194
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
195

    
196
# DJANGO SOCIAL AUTH PLUGIN SETTINGS
197

    
198
TWITTER_CONSUMER_KEY = ''
199
TWITTER_CONSUMER_SECRET = ''
200

    
201
FACEBOOK_APP_ID = ''
202
FACEBOOK_API_SECRET = ''
203

    
204
LINKEDIN_CONSUMER_KEY        = ''
205
LINKEDIN_CONSUMER_SECRET     = ''
206

    
207
LINKEDIN_SCOPE = ['r_basicprofile', 'r_emailaddress']
208
LINKEDIN_EXTRA_FIELD_SELECTORS = ['email-address', 'headline', 'industry']
209
LINKEDIN_EXTRA_DATA = [('id', 'id'),
210
                       ('first-name', 'first_name'),
211
                       ('last-name', 'last_name'),
212
                       ('email-address', 'email_address'),
213
                       ('headline', 'headline'),
214
                       ('industry', 'industry')]
215

    
216
YAHOO_CONSUMER_KEY = ''
217
YAHOO_CONSUMER_SECRET = ''
218

    
219
GOOGLE_SREG_EXTRA_DATA = []
220

    
221
SOCIAL_AUTH_FORCE_POST_DISCONNECT = True
222

    
223
FACEBOOK_EXTENDED_PERMISSIONS = ['email']
224

    
225
LOGIN_REDIRECT_URL = '/check'
226

    
227
SOCIAL_AUTH_FORCE_POST_DISCONNECT = True
228

    
229
SOCIAL_AUTH_CREATE_USERS = True
230
SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False
231
SOCIAL_AUTH_SANITIZE_REDIRECTS = False