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