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