1 #@PydevCodeAnalysisIgnore |
|
2 import os.path |
|
3 import ldtplatform |
|
4 # Django settings for project. |
|
5 |
|
6 DEBUG = True |
|
7 TEMPLATE_DEBUG = DEBUG |
|
8 |
|
9 ADMINS = ( |
|
10 # ('Your Name', 'your_email@domain.com'), |
|
11 ) |
|
12 |
|
13 MANAGERS = ADMINS |
|
14 |
|
15 DATABASES = { |
|
16 'default': { |
|
17 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
18 'NAME': '', # Or path to database file if using sqlite3. |
|
19 'USER': '', # Not used with sqlite3. |
|
20 'PASSWORD': '', # Not used with sqlite3. |
|
21 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
|
22 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
|
23 } |
|
24 } |
|
25 |
|
26 # Local time zone for this installation. Choices can be found here: |
|
27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
28 # although not all choices may be available on all operating systems. |
|
29 # If running in a Windows environment this must be set to the same as your |
|
30 # system time zone. |
|
31 TIME_ZONE = 'Europe/Paris' |
|
32 |
|
33 # Language code for this installation. All choices can be found here: |
|
34 # http://www.i18nguy.com/unicode/language-identifiers.html |
|
35 LANGUAGE_CODE = 'fr-fr' |
|
36 |
|
37 ugettext = lambda s: s |
|
38 |
|
39 LANGUAGES = ( |
|
40 ('fr', ugettext('French')), |
|
41 ('en', ugettext('English')), |
|
42 ) |
|
43 |
|
44 |
|
45 SITE_ID = 1 |
|
46 |
|
47 # If you set this to False, Django will make some optimizations so as not |
|
48 # to load the internationalization machinery. |
|
49 USE_I18N = True |
|
50 |
|
51 # Absolute path to the directory that holds media. |
|
52 # Example: "/home/media/media.lawrence.com/" |
|
53 #MEDIA_ROOT = '' |
|
54 |
|
55 # Root of static files used by each app, generated by code or uploaded by users |
|
56 #STATIC_URL = '/static/' |
|
57 |
|
58 # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
59 # trailing slash if there is a path component (optional in other cases). |
|
60 # Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
61 #MEDIA_URL = '' |
|
62 |
|
63 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
64 # trailing slash. |
|
65 # Examples: "http://foo.com/media/", "/media/". |
|
66 #ADMIN_MEDIA_PREFIX = '/media/' |
|
67 |
|
68 #LDT_MEDIA_PREFIX = '/ldt/' |
|
69 |
|
70 # Make this unique, and don't share it with anybody. |
|
71 SECRET_KEY = 't^lii5_z@tho$%6t&b#dm#t9nz$$ylyclxvkdiyqbl+(dnt(ma' |
|
72 |
|
73 # List of callables that know how to import templates from various sources. |
|
74 TEMPLATE_LOADERS = ( |
|
75 'django.template.loaders.filesystem.Loader', |
|
76 'django.template.loaders.app_directories.Loader', |
|
77 # 'django.template.loaders.eggs.Loader', |
|
78 ) |
|
79 |
|
80 MIDDLEWARE_CLASSES = ( |
|
81 'django.middleware.gzip.GZipMiddleware', |
|
82 'django.middleware.common.CommonMiddleware', |
|
83 'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware', |
|
84 'django.contrib.sessions.middleware.SessionMiddleware', |
|
85 'django.middleware.csrf.CsrfViewMiddleware', |
|
86 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
87 #'django.middleware.locale.LocaleMiddleware', |
|
88 'django.contrib.messages.middleware.MessageMiddleware', |
|
89 'django_openid_consumer.middleware.OpenIDMiddleware', |
|
90 'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware', |
|
91 ) |
|
92 |
|
93 TEMPLATE_CONTEXT_PROCESSORS = ( |
|
94 "django.core.context_processors.request", |
|
95 "django.contrib.auth.context_processors.auth", |
|
96 "django.core.context_processors.debug", |
|
97 "django.core.context_processors.i18n", |
|
98 "django.core.context_processors.media", |
|
99 "django.core.context_processors.static", |
|
100 "ldt.utils.context_processors.ldt_context", |
|
101 ) |
|
102 |
|
103 |
|
104 ROOT_URLCONF = 'ldtplatform.urls' |
|
105 |
|
106 TEMPLATE_DIRS = ( |
|
107 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
108 # Always use forward slashes, even on Windows. |
|
109 # Don't forget to use absolute paths, not relative paths. |
|
110 os.path.join(os.path.basename(__file__), 'templates'), |
|
111 os.path.join(os.path.dirname(__file__), 'templates'), |
|
112 ) |
|
113 |
|
114 FIXTURES_DIRS = ( |
|
115 os.path.join(os.path.basename(__file__), 'fixtures'), |
|
116 ) |
|
117 |
|
118 INSTALLED_APPS = ( |
|
119 'django_extensions', |
|
120 'django.contrib.auth', |
|
121 'django.contrib.contenttypes', |
|
122 'django.contrib.sessions', |
|
123 'django.contrib.sites', |
|
124 'django.contrib.messages', |
|
125 'django.contrib.admin', |
|
126 'django.contrib.staticfiles', |
|
127 'ldtplatform', |
|
128 'registration', |
|
129 'tagging', |
|
130 'ldt', |
|
131 'ldt.core', |
|
132 'ldt.ldt_utils', |
|
133 'ldt.text', |
|
134 'ldt.user', |
|
135 'ldt.management', |
|
136 'oauth_provider', |
|
137 'django_openid_consumer', |
|
138 'piston', |
|
139 'social_auth', |
|
140 'south', |
|
141 ) |
|
142 |
|
143 AUTH_PROFILE_MODULE = 'user.UserProfile' |
|
144 |
|
145 DECOUPAGE_BLACKLIST = ( |
|
146 "de_PPP", |
|
147 ) |
|
148 |
|
149 ZIP_BLACKLIST = ( |
|
150 "__MACOSX", |
|
151 ) |
|
152 |
|
153 AUTHENTICATION_BACKENDS = ( |
|
154 'social_auth.backends.twitter.TwitterBackend', |
|
155 'social_auth.backends.facebook.FacebookBackend', |
|
156 # 'social_auth.backends.google.GoogleOAuthBackend', |
|
157 # 'social_auth.backends.google.GoogleOAuth2Backend', |
|
158 'social_auth.backends.google.GoogleBackend', |
|
159 'social_auth.backends.yahoo.YahooBackend', |
|
160 # 'social_auth.backends.contrib.linkedin.LinkedinBackend', |
|
161 # 'social_auth.backends.contrib.LiveJournalBackend', |
|
162 # 'social_auth.backends.contrib.orkut.OrkutBackend', |
|
163 'social_auth.backends.OpenIDBackend', |
|
164 'django.contrib.auth.backends.ModelBackend', |
|
165 ) |
|
166 SOCIAL_AUTH_IMPORT_BACKENDS = ( |
|
167 'myproy.social_auth_extra_services', |
|
168 ) |
|
169 |
|
170 ACCOUNT_ACTIVATION_DAYS = 7 |
|
171 |
|
172 LDT_MAX_SEARCH_NUMBER = 50 |
|
173 LDT_JSON_DEFAULT_INDENT = 2 |
|
174 |
|
175 OAUTH_PROVIDER_KEY_SIZE = 32 |
|
176 OAUTH_PROVIDER_SECRET_SIZE = 32 |
|
177 OAUTH_PROVIDER_VERIFIER_SIZE = 10 |
|
178 OAUTH_PROVIDER_CONSUMER_KEY_SIZE = 256 |
|
179 OAUTH_AUTHORIZE_VIEW = 'oauth_provider.views.fake_authorize_view' |
|
180 OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view' |
|
181 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888" |
|
182 |
|
183 TWITTER_CONSUMER_KEY = 'UxAdbOLSo4Mx3CXIwDG9Eg' |
|
184 TWITTER_CONSUMER_SECRET = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww' |
|
185 FACEBOOK_APP_ID = '163134140411313' |
|
186 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012' |
|
187 |
|
188 SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete' |
|
189 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' |
|
190 |
|
191 # twitter testing |
|
192 TEST_TWITTER_USER = 'jacquesverrier@gmail.com' |
|
193 TEST_TWITTER_PASSWORD = '' |
|
194 |
|
195 # facebook testing |
|
196 #TEST_FACEBOOK_USER = 'testing_account' |
|
197 #TEST_FACEBOOK_PASSWORD = 'password_for_testing_account' |
|
198 |
|
199 # google testing |
|
200 TEST_GOOGLE_USER = 'jacquesverrier@gmail.com' |
|
201 TEST_GOOGLE_PASSWORD = '' |
|
202 |
|
203 AUTO_INDEX_AFTER_SAVE = True |
|
204 |
|
205 WEB_VERSION = ldtplatform.get_version() |
|
206 |
|
207 from config import * |
|
208 |
|
209 if not "LOGIN_URL" in locals(): |
|
210 LOGIN_URL = BASE_URL + 'ldtplatform/accounts/login/' |
|
211 if not "LOGOUT_URL" in locals(): |
|
212 LOGOUT_URL = BASE_URL + 'ldtplatform/accounts/disconnect/' |
|
213 if not "LOGIN_REDIRECT_URL" in locals(): |
|
214 LOGIN_REDIRECT_URL = BASE_URL + 'ldtplatform/ldt/' |
|
215 if not "LOGOUT_REDIRECT_URL" in locals(): |
|
216 LOGOUT_REDIRECT_URL = BASE_URL + 'ldtplatform/accounts/login' |
|
217 if not "PROFILE_REDIRECT_URL" in locals(): |
|
218 PROFILE_REDIRECT_URL = BASE_URL + 'ldtplatform/auth_accounts/create/profile' |
|
219 |
|
220 if not "LOGIN_ERROR_URL" in locals(): |
|
221 LOGIN_ERROR_URL = BASE_URL + 'ldtplatform/accounts/login' |
|
222 |
|
223 if not "GLOBAL_LOG_LEVEL" in locals(): |
|
224 GLOBAL_LOG_LEVEL = LOG_LEVEL |
|
225 if not "GLOBAL_LOG_HANDLERS" in locals(): |
|
226 GLOBAL_LOG_HANDLERS = [{'handler':logging.FileHandler(LOG_FILE), 'format':"%(asctime)s - %(levelname)s : %(message)s"}] |
|
227 |
|
228 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
229 # trailing slash. |
|
230 # Examples: "http://foo.com/media/", "/media/". |
|
231 if not "ADMIN_MEDIA_PREFIX" in locals(): |
|
232 ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' |
|
233 # Used in a lot of templates |
|
234 if not "LDT_MEDIA_PREFIX" in locals(): |
|
235 LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' |
|
236 # URL that handles the media served from MEDIA_ROOT. |
|
237 if not "MEDIA_URL" in locals(): |
|
238 MEDIA_URL = BASE_URL + 'static/media/' |
|
239 |
|