view to submitting jobs
[qcg-portal.git] / plgng / settings.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
17 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
18
19
20 # Quick-start development settings - unsuitable for production
21 # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
22
23 # SECURITY WARNING: keep the secret key used in production secret!
24 SECRET_KEY = 'x%_rlnhibsxum1m5o_c5ac@p0nw+1r0&#k!v3+52)s(d=2$5y&'
25
26 # SECURITY WARNING: don't run with debug turned on in production!
27 DEBUG = True
28
29 TEMPLATE_DEBUG = True
30
31 ALLOWED_HOSTS = []
32
33
34 # Application definition
35
36 INSTALLED_APPS = (
37     'grappelli',
38     'django.contrib.admin',
39     'django.contrib.auth',
40     'django.contrib.contenttypes',
41     'django.contrib.sessions',
42     'django.contrib.messages',
43     'django.contrib.staticfiles',
44     'django.contrib.webdesign',
45     'qcg',
46     'django_openid_auth',
47     'bootstrap3',
48 )
49
50 MIDDLEWARE_CLASSES = (
51     'django.contrib.sessions.middleware.SessionMiddleware',
52     'django.middleware.common.CommonMiddleware',
53     'django.middleware.csrf.CsrfViewMiddleware',
54     'django.contrib.auth.middleware.AuthenticationMiddleware',
55     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
56     'django.contrib.messages.middleware.MessageMiddleware',
57     'django.middleware.clickjacking.XFrameOptionsMiddleware',
58 )
59
60 TEMPLATE_CONTEXT_PROCESSORS = defaults.TEMPLATE_CONTEXT_PROCESSORS + (
61     'django.core.context_processors.request',
62 )
63
64 ROOT_URLCONF = 'plgng.urls'
65
66 WSGI_APPLICATION = 'plgng.wsgi.application'
67
68
69 # Database
70 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
71
72 DATABASES = {
73     'default': {
74         'ENGINE': 'django.db.backends.sqlite3',
75         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
76     }
77 }
78
79 # Internationalization
80 # https://docs.djangoproject.com/en/1.7/topics/i18n/
81
82 LANGUAGE_CODE = 'pl'
83
84 TIME_ZONE = 'Europe/Warsaw'
85
86 USE_I18N = True
87
88 USE_L10N = True
89
90 USE_TZ = True
91
92
93 CUSTOM_DATETIME_FORMAT = 'j b Y, H:i'
94
95
96 # Static files (CSS, JavaScript, Images)
97 # https://docs.djangoproject.com/en/1.7/howto/static-files/
98
99 STATIC_URL = '/static/'
100
101
102 # Authentication
103
104 AUTH_USER_MODEL = 'qcg.User'
105
106 AUTHENTICATION_BACKENDS = (
107     'django_openid_auth.auth.OpenIDBackend',
108     'django.contrib.auth.backends.ModelBackend',
109 )
110
111 LOGIN_URL = 'openid-login'
112 LOGIN_REDIRECT_URL = '/jobs/'
113
114 # If set, always use this as the identity URL rather than asking the
115 # user.  This only makes sense if it is a server URL.
116 OPENID_SSO_SERVER_URL = 'https://openid.plgrid.pl/gateway'
117
118 # Should users be created when new OpenIDs are used to log in?
119 OPENID_CREATE_USERS = True
120
121 # Update user details from OpenID each time they log in
122 OPENID_UPDATE_DETAILS_FROM_SREG = True
123
124 # Login will fail if no 'nickname' (username), or if the nickname
125 # conflicts with an existing user with a different openid identity url
126 OPENID_STRICT_USERNAMES = True
127
128
129 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
130
131
132 # 3-rd party settings
133
134 BOOTSTRAP3 = {
135     'horizontal_label_class': 'col-sm-3 col-md-4',
136     'horizontal_field_class': 'col-sm-9 col-md-6',
137     'set_placeholder': False,
138 }