Upgrades
[cas.git] / src / cas / settings.py
1 from os import path
2
3 PROJECT_ROOT = path.realpath(path.dirname(__file__))
4
5 DEBUG = True
6
7 ADMINS = [
8 ]
9
10 MANAGERS = ADMINS
11
12 DATABASES = {
13     'default': {
14         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
15         'NAME': path.join(PROJECT_ROOT, 'dev.sqlite'), # Or path to database file if using sqlite3.
16         'USER': '',                      # Not used with sqlite3.
17         'PASSWORD': '',                  # Not used with sqlite3.
18         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
19         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
20     }
21 }
22
23 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
24
25 # Local time zone for this installation. Choices can be found here:
26 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
27 # although not all choices may be available on all operating systems.
28 # If running in a Windows environment this must be set to the same as your
29 # system time zone.
30 TIME_ZONE = 'UTC'
31
32 # Language code for this installation. All choices can be found here:
33 # http://www.i18nguy.com/unicode/language-identifiers.html
34 LANGUAGE_CODE = 'pl'
35
36 SITE_ID = 1
37
38 # If you set this to False, Django will make some optimizations so as not
39 # to load the internationalization machinery.
40 USE_I18N = True
41
42 USE_TZ = True
43
44 # Absolute path to the directory that holds media.
45 # Example: "/home/media/media.lawrence.com/"
46 MEDIA_ROOT = path.join(PROJECT_ROOT, '../../media/')
47
48 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
49 # trailing slash if there is a path component (optional in other cases).
50 # Examples: "http://media.lawrence.com", "http://example.com/media/"
51 MEDIA_URL = '/media/'
52
53 STATIC_ROOT = path.join(PROJECT_ROOT, '../../static/')
54 STATIC_URL = '/static/'
55
56 STATICFILES_DIRS = [
57     path.join(PROJECT_ROOT, 'static'),
58 ]
59
60 ROOT_URLCONF = 'cas.urls'
61
62 TEMPLATES = [
63     {
64         'BACKEND': 'django.template.backends.django.DjangoTemplates',
65         'APP_DIRS': True,
66         'DIRS': [
67             PROJECT_ROOT + '/templates',
68         ],
69         'OPTIONS': {
70             'context_processors': [
71                 "django.contrib.auth.context_processors.auth",
72                 "django.template.context_processors.debug",
73                 "django.template.context_processors.i18n",
74                 "django.template.context_processors.media",
75                 "django.template.context_processors.static",
76                 "django.template.context_processors.tz",
77                 "django.contrib.messages.context_processors.messages",
78                 "django.template.context_processors.request",
79             ],
80             'debug': DEBUG,
81         },
82     },
83 ]
84
85 LOCALE_PATHS = (
86     PROJECT_ROOT + '/locale',
87 )
88
89 INSTALLED_APPS = (
90     'accounts.apps.AccountsConfig',
91     'emails.apps.EmailsConfig',
92     'ftp',
93     'services.apps.ServicesConfig',
94     'ssh_keys.apps.SshKeysConfig',
95
96     'cas_provider',
97     'django_gravatar',
98     'oidc_provider',
99
100     'django.contrib.auth',
101     'django.contrib.contenttypes',
102     'django.contrib.messages',
103     'django.contrib.sessions',
104     'django.contrib.sites',
105     'django.contrib.admin',
106     'django.contrib.admindocs',
107     'django.contrib.staticfiles',
108 )
109
110 MIDDLEWARE = (
111     'django.contrib.sessions.middleware.SessionMiddleware',
112     'django.middleware.common.CommonMiddleware',
113     'django.middleware.csrf.CsrfViewMiddleware',
114     'django.contrib.auth.middleware.AuthenticationMiddleware',
115     'django.contrib.messages.middleware.MessageMiddleware',
116     'django.middleware.clickjacking.XFrameOptionsMiddleware',
117 )
118
119 # django-cas-provider settings
120 LOGIN_URL = '/cas/login/'
121 LOGOUT_URL = '/cas/logout/'
122 LOGIN_REDIRECT_URL = '/accounts/'
123 CAS_CUSTOM_ATTRIBUTES_CALLBACK = 'cas.utils.custom_attributes_callback'
124 SESSION_COOKIE_NAME = 'fnpcas'
125
126 GRAVATAR_DEFAULT_IMAGE = 'mm'
127 GRAVATAR_URL_PREFIX = 'https://www.gravatar.com/'
128
129 SITE_TITLE = 'Fundacja Nowoczesna Polska'
130
131
132 OIDC_USERINFO = 'emails.oidc.userinfo'
133
134
135 # Import localsettings file, which may override settings defined here
136 try:
137     from .localsettings import *
138 except ImportError:
139     pass