add logging to settings
[qcg-portal.git] / plgng / settings_common.py
1 """
2 Django settings for plgng 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 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12 import os
13
14 import django.conf.global_settings as defaults
15
16 from local import *
17 from settings_logging import LOGGING
18
19 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
20
21
22 # Application definition
23
24 INSTALLED_APPS = (
25     'grappelli',
26     'django.contrib.admin',
27     'django.contrib.auth',
28     'django.contrib.contenttypes',
29     'django.contrib.sessions',
30     'django.contrib.messages',
31     'django.contrib.staticfiles',
32     'django.contrib.webdesign',
33     'qcg',
34     'django_openid_auth',
35     'bootstrap3',
36 )
37
38 MIDDLEWARE_CLASSES = (
39     'django.contrib.sessions.middleware.SessionMiddleware',
40     'django.middleware.common.CommonMiddleware',
41     'django.middleware.csrf.CsrfViewMiddleware',
42     'django.contrib.auth.middleware.AuthenticationMiddleware',
43     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
44     'django.contrib.messages.middleware.MessageMiddleware',
45     'django.middleware.clickjacking.XFrameOptionsMiddleware',
46 )
47
48 TEMPLATE_CONTEXT_PROCESSORS = defaults.TEMPLATE_CONTEXT_PROCESSORS + (
49     'django.core.context_processors.request',
50 )
51
52 ROOT_URLCONF = 'plgng.urls'
53
54 WSGI_APPLICATION = 'plgng.wsgi.application'
55
56
57 # Internationalization
58 # https://docs.djangoproject.com/en/1.7/topics/i18n/
59
60 LANGUAGE_CODE = 'pl'
61
62 TIME_ZONE = 'Europe/Warsaw'
63
64 USE_I18N = True
65
66 USE_L10N = True
67
68 USE_TZ = True
69
70
71 CUSTOM_DATETIME_FORMAT = 'j b Y, H:i'
72
73
74 # Static files (CSS, JavaScript, Images)
75 # https://docs.djangoproject.com/en/1.7/howto/static-files/
76
77 STATIC_URL = '/static/'
78
79
80 # Authentication
81
82 AUTH_USER_MODEL = 'qcg.User'
83
84 AUTHENTICATION_BACKENDS = (
85     'django_openid_auth.auth.OpenIDBackend',
86     'django.contrib.auth.backends.ModelBackend',
87 )
88
89 LOGIN_URL = 'openid-login'
90 LOGIN_REDIRECT_URL = '/jobs/'
91
92 # If set, always use this as the identity URL rather than asking the
93 # user.  This only makes sense if it is a server URL.
94 OPENID_SSO_SERVER_URL = 'https://openid.plgrid.pl/gateway'
95
96 # Should users be created when new OpenIDs are used to log in?
97 OPENID_CREATE_USERS = True
98
99 # Update user details from OpenID each time they log in
100 OPENID_UPDATE_DETAILS_FROM_SREG = True
101
102 # Login will fail if no 'nickname' (username), or if the nickname
103 # conflicts with an existing user with a different openid identity url
104 OPENID_STRICT_USERNAMES = True
105
106
107 SESSION_COOKIE_NAME = 'qcg_session'
108 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
109
110
111 # 3-rd party settings
112
113 BOOTSTRAP3 = {
114     'horizontal_label_class': 'col-sm-3 col-md-4',
115     'horizontal_field_class': 'col-sm-9 col-md-6',
116     'set_placeholder': False,
117 }