Nicer for admin.
[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 # Local time zone for this installation. Choices can be found here:
24 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25 # although not all choices may be available on all operating systems.
26 # If running in a Windows environment this must be set to the same as your
27 # system time zone.
28 TIME_ZONE = 'UTC'
29
30 # Language code for this installation. All choices can be found here:
31 # http://www.i18nguy.com/unicode/language-identifiers.html
32 LANGUAGE_CODE = 'pl'
33
34 SITE_ID = 1
35
36 # If you set this to False, Django will make some optimizations so as not
37 # to load the internationalization machinery.
38 USE_I18N = True
39
40 # Absolute path to the directory that holds media.
41 # Example: "/home/media/media.lawrence.com/"
42 MEDIA_ROOT = path.join(PROJECT_ROOT, '../../media/')
43
44 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
45 # trailing slash if there is a path component (optional in other cases).
46 # Examples: "http://media.lawrence.com", "http://example.com/media/"
47 MEDIA_URL = '/media/'
48
49 STATIC_ROOT = path.join(PROJECT_ROOT, '../../static/')
50 STATIC_URL = '/static/'
51
52 STATICFILES_DIRS = [
53     path.join(PROJECT_ROOT, 'static'),
54 ]
55
56 ROOT_URLCONF = 'cas.urls'
57
58 TEMPLATES = [
59     {
60         'BACKEND': 'django.template.backends.django.DjangoTemplates',
61         'APP_DIRS': True,
62         'DIRS': [
63             PROJECT_ROOT + '/templates',
64         ],
65         'OPTIONS': {
66             'context_processors': [
67                 "django.contrib.auth.context_processors.auth",
68                 "django.template.context_processors.debug",
69                 "django.template.context_processors.i18n",
70                 "django.template.context_processors.media",
71                 "django.template.context_processors.static",
72                 "django.template.context_processors.tz",
73                 "django.contrib.messages.context_processors.messages",
74                 "django.template.context_processors.request",
75             ],
76             'debug': DEBUG,
77         },
78     },
79 ]
80
81 LOCALE_PATHS = (
82     PROJECT_ROOT + '/locale',
83 )
84
85 INSTALLED_APPS = (
86     'accounts.apps.AccountsConfig',
87     'services.apps.ServicesConfig',
88     'ssh_keys.apps.SshKeysConfig',
89
90     'cas_provider',
91     'django_gravatar',
92
93     'django.contrib.auth',
94     'django.contrib.contenttypes',
95     'django.contrib.sessions',
96     'django.contrib.sites',
97     'django.contrib.admin',
98     'django.contrib.admindocs',
99     'django.contrib.staticfiles',
100 )
101
102 MIDDLEWARE = (
103     'django.contrib.sessions.middleware.SessionMiddleware',
104     'django.middleware.common.CommonMiddleware',
105     'django.middleware.csrf.CsrfViewMiddleware',
106     'django.contrib.auth.middleware.AuthenticationMiddleware',
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