add date rage picker
[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 )
48
49 MIDDLEWARE_CLASSES = (
50     'django.contrib.sessions.middleware.SessionMiddleware',
51     'django.middleware.common.CommonMiddleware',
52     'django.middleware.csrf.CsrfViewMiddleware',
53     'django.contrib.auth.middleware.AuthenticationMiddleware',
54     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
55     'django.contrib.messages.middleware.MessageMiddleware',
56     'django.middleware.clickjacking.XFrameOptionsMiddleware',
57 )
58
59 TEMPLATE_CONTEXT_PROCESSORS = defaults.TEMPLATE_CONTEXT_PROCESSORS + (
60     'django.core.context_processors.request',
61 )
62
63 ROOT_URLCONF = 'plgng.urls'
64
65 WSGI_APPLICATION = 'plgng.wsgi.application'
66
67
68 # Database
69 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
70
71 DATABASES = {
72     'default': {
73         'ENGINE': 'django.db.backends.sqlite3',
74         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
75     }
76 }
77
78 # Internationalization
79 # https://docs.djangoproject.com/en/1.7/topics/i18n/
80
81 LANGUAGE_CODE = 'pl'
82
83 TIME_ZONE = 'Europe/Warsaw'
84
85 USE_I18N = True
86
87 USE_L10N = True
88
89 USE_TZ = True
90
91
92 CUSTOM_DATETIME_FORMAT = 'j b Y, G:i'
93
94
95 # Static files (CSS, JavaScript, Images)
96 # https://docs.djangoproject.com/en/1.7/howto/static-files/
97
98 STATIC_URL = '/static/'
99
100
101 # Authentication
102
103 AUTH_USER_MODEL = 'qcg.User'
104
105 AUTHENTICATION_BACKENDS = (
106     'django_openid_auth.auth.OpenIDBackend',
107     'django.contrib.auth.backends.ModelBackend',
108 )
109
110 LOGIN_URL = 'openid-login'
111 LOGIN_REDIRECT_URL = '/jobs/'
112
113 # If set, always use this as the identity URL rather than asking the
114 # user.  This only makes sense if it is a server URL.
115 OPENID_SSO_SERVER_URL = 'https://openid.plgrid.pl/gateway'
116
117 # Should users be created when new OpenIDs are used to log in?
118 OPENID_CREATE_USERS = True
119
120 # Update user details from OpenID each time they log in
121 OPENID_UPDATE_DETAILS_FROM_SREG = True
122
123 # Login will fail if no 'nickname' (username), or if the nickname
124 # conflicts with an existing user with a different openid identity url
125 OPENID_STRICT_USERNAMES = True
126
127
128 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'