| author | ymh <ymh.work@gmail.com> |
| Thu, 09 Jan 2020 13:37:23 +0100 | |
| changeset 298 | c40c501bca19 |
| parent 284 | 33183949c9b8 |
| permissions | -rw-r--r-- |
| 4 | 1 |
# Django settings for egonomy project. |
2 |
||
3 |
DEBUG = True |
|
4 |
TEMPLATE_DEBUG = DEBUG |
|
5 |
||
6 |
ADMINS = ( |
|
7 |
# ('Your Name', 'your_email@example.com'), |
|
8 |
) |
|
9 |
||
10 |
MANAGERS = ADMINS |
|
11 |
||
12 |
DATABASES = { |
|
13 |
'default': { |
|
14 |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
|
15 |
'NAME': '', # Or path to database file if using sqlite3. |
|
16 |
# The following settings are not used with sqlite3: |
|
17 |
'USER': '', |
|
18 |
'PASSWORD': '', |
|
19 |
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
|
20 |
'PORT': '', # Set to empty string for default. |
|
21 |
} |
|
22 |
} |
|
23 |
||
| 36 | 24 |
HAYSTACK_CONNECTIONS = { |
25 |
'default': { |
|
26 |
'ENGINE': '', |
|
27 |
'URL': '', |
|
28 |
'INDEX_NAME': '', |
|
29 |
}, |
|
30 |
} |
|
31 |
||
| 4 | 32 |
# Local time zone for this installation. Choices can be found here: |
33 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
34 |
# although not all choices may be available on all operating systems. |
|
35 |
# In a Windows environment this must be set to your system time zone. |
|
36 |
TIME_ZONE = 'America/Chicago' |
|
37 |
||
38 |
# Language code for this installation. All choices can be found here: |
|
39 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
40 |
LANGUAGE_CODE = 'en-us' |
|
41 |
||
42 |
SITE_ID = 1 |
|
43 |
||
44 |
# If you set this to False, Django will make some optimizations so as not |
|
45 |
# to load the internationalization machinery. |
|
46 |
USE_I18N = True |
|
47 |
||
48 |
# If you set this to False, Django will not format dates, numbers and |
|
49 |
# calendars according to the current locale. |
|
50 |
USE_L10N = True |
|
51 |
||
52 |
# If you set this to False, Django will not use timezone-aware datetimes. |
|
53 |
USE_TZ = True |
|
54 |
||
55 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
|
56 |
# Example: "/var/www/example.com/media/" |
|
57 |
MEDIA_ROOT = '' |
|
58 |
||
59 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
60 |
# trailing slash. |
|
61 |
# Examples: "http://example.com/media/", "http://media.example.com/" |
|
62 |
MEDIA_URL = '' |
|
63 |
||
64 |
# Absolute path to the directory static files should be collected to. |
|
65 |
# Don't put anything in this directory yourself; store your static files |
|
66 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
67 |
# Example: "/var/www/example.com/static/" |
|
68 |
STATIC_ROOT = '' |
|
69 |
||
70 |
# URL prefix for static files. |
|
71 |
# Example: "http://example.com/static/", "http://static.example.com/" |
|
72 |
STATIC_URL = '/static/' |
|
73 |
||
74 |
# Additional locations of static files |
|
75 |
STATICFILES_DIRS = ( |
|
76 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
|
77 |
# Always use forward slashes, even on Windows. |
|
78 |
# Don't forget to use absolute paths, not relative paths. |
|
79 |
) |
|
80 |
||
81 |
# List of finder classes that know how to find static files in |
|
82 |
# various locations. |
|
83 |
STATICFILES_FINDERS = ( |
|
84 |
'django.contrib.staticfiles.finders.FileSystemFinder', |
|
85 |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
86 |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
|
87 |
) |
|
88 |
||
89 |
# Make this unique, and don't share it with anybody. |
|
90 |
SECRET_KEY = 'z0^ex@s2*e@x00x1gq83c+(6xjxyi5*gfadu)+1mijvr%4g!@$' |
|
91 |
||
92 |
# List of callables that know how to import templates from various sources. |
|
93 |
TEMPLATE_LOADERS = ( |
|
94 |
'django.template.loaders.filesystem.Loader', |
|
95 |
'django.template.loaders.app_directories.Loader', |
|
96 |
# 'django.template.loaders.eggs.Loader', |
|
97 |
) |
|
98 |
||
99 |
MIDDLEWARE_CLASSES = ( |
|
100 |
'django.middleware.common.CommonMiddleware', |
|
101 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
102 |
'django.middleware.csrf.CsrfViewMiddleware', |
|
103 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
104 |
'django.contrib.messages.middleware.MessageMiddleware', |
|
|
271
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
105 |
'egonomy.auth.middleware.EgonomyUserTokenMiddleware' |
| 4 | 106 |
# Uncomment the next line for simple clickjacking protection: |
107 |
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
108 |
) |
|
109 |
||
|
105
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
110 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
111 |
"django.contrib.auth.context_processors.auth", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
112 |
"django.core.context_processors.debug", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
113 |
"django.core.context_processors.i18n", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
114 |
"django.core.context_processors.media", |
| 268 | 115 |
"django.core.context_processors.request", |
|
105
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
116 |
"django.core.context_processors.static", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
117 |
"django.core.context_processors.tz", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
118 |
"django.contrib.messages.context_processors.messages", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
119 |
"egonomy.utils.context_processors.egonomy_context", |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
120 |
) |
|
2b004344ebf2
add version number in template. Upgrade version number to v0.3.2.
cavaliet
parents:
38
diff
changeset
|
121 |
|
| 4 | 122 |
ROOT_URLCONF = 'egonomy.urls' |
123 |
||
124 |
# Python dotted path to the WSGI application used by Django's runserver. |
|
125 |
WSGI_APPLICATION = 'egonomy.wsgi.application' |
|
126 |
||
127 |
TEMPLATE_DIRS = ( |
|
128 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
129 |
# Always use forward slashes, even on Windows. |
|
130 |
# Don't forget to use absolute paths, not relative paths. |
|
131 |
) |
|
132 |
||
133 |
INSTALLED_APPS = ( |
|
|
230
fb6932ba9a2b
update registration and password management, and version number to 0.6.10
cavaliet
parents:
229
diff
changeset
|
134 |
'egonomy', |
| 4 | 135 |
'django.contrib.auth', |
136 |
'django.contrib.contenttypes', |
|
137 |
'django.contrib.sessions', |
|
138 |
'django.contrib.sites', |
|
139 |
'django.contrib.messages', |
|
140 |
'django.contrib.staticfiles', |
|
| 9 | 141 |
'django.contrib.admin', |
142 |
'django.contrib.admindocs', |
|
| 21 | 143 |
'django_extensions', |
144 |
'south', |
|
| 229 | 145 |
'registration', |
| 17 | 146 |
'sorl.thumbnail', |
| 36 | 147 |
'haystack', |
| 247 | 148 |
'tastypie', |
| 4 | 149 |
) |
150 |
||
| 13 | 151 |
ugettext = lambda s: s |
152 |
LANGUAGES = ( |
|
153 |
('fr', ugettext('French')), |
|
154 |
('en', ugettext('English')), |
|
155 |
) |
|
156 |
||
| 4 | 157 |
# A sample logging configuration. The only tangible logging |
158 |
# performed by this configuration is to send an email to |
|
159 |
# the site admins on every HTTP 500 error when DEBUG=False. |
|
160 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
|
161 |
# more details on how to customize your logging configuration. |
|
162 |
LOGGING = { |
|
163 |
'version': 1, |
|
164 |
'disable_existing_loggers': False, |
|
165 |
'filters': { |
|
166 |
'require_debug_false': { |
|
167 |
'()': 'django.utils.log.RequireDebugFalse' |
|
168 |
} |
|
169 |
}, |
|
170 |
'handlers': { |
|
171 |
'mail_admins': { |
|
172 |
'level': 'ERROR', |
|
173 |
'filters': ['require_debug_false'], |
|
174 |
'class': 'django.utils.log.AdminEmailHandler' |
|
175 |
} |
|
176 |
}, |
|
177 |
'loggers': { |
|
178 |
'django.request': { |
|
179 |
'handlers': ['mail_admins'], |
|
180 |
'level': 'ERROR', |
|
181 |
'propagate': True, |
|
182 |
}, |
|
183 |
} |
|
184 |
} |
|
185 |
||
|
271
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
186 |
AUTHENTICATION_BACKENDS = ( |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
187 |
'django.contrib.auth.backends.ModelBackend', |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
188 |
'egonomy.auth.backends.EgonomyBackend', |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
189 |
) |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
190 |
|
| 36 | 191 |
|
192 |
HAYSTACK_SIGNAL_PROCESSOR = 'egonomy.search_indexes.EgonomySignalProcessor' |
|
| 229 | 193 |
ACCOUNT_ACTIVATION_DAYS = 7 |
| 247 | 194 |
TASTYPIE_DEFAULT_FORMATS = ['json'] |
| 36 | 195 |
|
|
279
3929b6ed3bf9
correct default value for egonomy_url
ymh <ymh.work@gmail.com>
parents:
273
diff
changeset
|
196 |
EGONOMY_URL = '' |
|
284
33183949c9b8
break authentication loop on egonomy
ymh <ymh.work@gmail.com>
parents:
279
diff
changeset
|
197 |
EGONOMY_SERVER_IP = '' |
|
271
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
198 |
EGONOMY_LOGIN_URL ='' |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
199 |
EGONOMY_SALT_LENGTH = 12 |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
200 |
EGONOMY_TOKEN_NAME = 'egonomytoken' |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
201 |
EGONOMY_TOKEN_CHECK_URL = '' |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
202 |
|
| 273 | 203 |
EGONOMY_HTTP_USER = None |
204 |
EGONOMY_HTTP_PASSWORD = None |
|
205 |
||
|
271
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
206 |
EGONOMY_USER_PREFIX = 'egonomy:' |
|
4e7178ce5688
Implement single sign on with egonomy - mobenfact
ymh <ymh.work@gmail.com>
parents:
268
diff
changeset
|
207 |
|
| 21 | 208 |
from .config import * #@UnusedWildImport |
| 28 | 209 |
|
|
33
71028c5eb7eb
Correct settings. Add SRC_BASE_URL that points to the django site root
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
210 |
if not "SRC_BASE_URL" in locals(): |
|
71028c5eb7eb
Correct settings. Add SRC_BASE_URL that points to the django site root
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
211 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
| 28 | 212 |
|
213 |
if not "LOGIN_URL" in locals(): |
|
|
33
71028c5eb7eb
Correct settings. Add SRC_BASE_URL that points to the django site root
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
214 |
LOGIN_URL = SRC_BASE_URL + 'login/' |
|
71028c5eb7eb
Correct settings. Add SRC_BASE_URL that points to the django site root
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
215 |
|
| 36 | 216 |
if not "IMAGES_PER_PAGE" in locals(): |
217 |
IMAGES_PER_PAGE = 32 |
|
| 38 | 218 |
|
219 |
HAYSTACK_ITERATOR_LOAD_PER_QUERY = IMAGES_PER_PAGE |
|
220 |
||
221 |