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